marcqualie/cloudapp-export

View on GitHub
lib/cloudapp_export/item.rb

Summary

Maintainability
A
0 mins
Test Coverage
module CloudappExport
  class Item
    attr_reader :attributes

    def initialize(attributes)
      @attributes = attributes
    end

    def [](key)
      @attributes[key]
    end

    def name
      @attributes['name']
    end

    def filename
      ext = @attributes['name'].split('.').last
      "#{@attributes['slug']}.#{ext}"
    end
  end
end