Class: Fleakr::Objects::Collection
- Inherits:
-
Object
- Object
- Fleakr::Objects::Collection
- Includes:
- Support::Object
- Defined in:
- lib/fleakr/objects/collection.rb
Overview
Collection
Attributes
- id
-
The ID for this photoset
- title
-
The title of this photoset
- description
-
The description of this set
- count
-
Count of photos in this set
Associations
- photos
-
The collection of photos for this set. See Fleakr::Objects::Photo
- comments
-
All comments associated with this set. See Fleakr::Objects::Comment
Instance Attribute Summary collapse
-
#collections ⇒ Object
flickr_attribute :count, :from => ‘@photos’.
-
#sets ⇒ Object
flickr_attribute :count, :from => ‘@photos’.
Instance Method Summary collapse
-
#initialize(document = nil) ⇒ Collection
constructor
A new instance of Collection.
Methods included from Support::Object
Constructor Details
#initialize(document = nil) ⇒ Collection
Returns a new instance of Collection.
28 29 30 31 32 33 34 35 |
# File 'lib/fleakr/objects/collection.rb', line 28 def initialize(document=nil) self.class.attributes.each do |attribute| value = attribute.value_from(document) self.send("#{attribute.name}=".to_sym, value) unless value.nil? end self.sets = document.search("//set").map{|s| Fleakr::Objects::Set.new(s)} || [] self.collections = recurse_collections(document.search("//collection")) end |
Instance Attribute Details
#collections ⇒ Object
flickr_attribute :count, :from => ‘@photos’
24 25 26 |
# File 'lib/fleakr/objects/collection.rb', line 24 def collections @collections end |
#sets ⇒ Object
flickr_attribute :count, :from => ‘@photos’
24 25 26 |
# File 'lib/fleakr/objects/collection.rb', line 24 def sets @sets end |