Class: AudioVision::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/audio_vision/asset.rb

Defined Under Namespace

Classes: Size

Constant Summary collapse

ATTRIBUTES =
[
  :caption,
  :owner,
  :title
]
SIZES =
[
  :thumbnail,
  :small,
  :large,
  :full
]

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Asset

Returns a new instance of Asset.



30
31
32
33
34
35
36
37
38
# File 'lib/audio_vision/asset.rb', line 30

def initialize(attributes={})
  @caption  = attributes["caption"]
  @owner    = attributes["owner"]
  @title    = attributes["title"]

  SIZES.each do |size|
    self.send("#{size}=", Asset::Size.new(attributes[size.to_s]))
  end
end