class Flickr::AttributeSet
Container for the attributes.
@private
Public Class Methods
new(*attributes)
click to toggle source
# File lib/flickr/attributes.rb, line 165 def initialize(*attributes) @attributes = Array.new(attributes) end
Public Instance Methods
<<(attribute)
click to toggle source
# File lib/flickr/attributes.rb, line 193 def <<(attribute) @attributes << attribute self end
add_locations(hash)
click to toggle source
Shorthand for adding locations to multiple attributes at once.
# File lib/flickr/attributes.rb, line 187 def add_locations(hash) hash.each do |attribute_name, locations| find(attribute_name).add_locations(locations) end end
each(*args, &block)
click to toggle source
# File lib/flickr/attributes.rb, line 169 def each(*args, &block) @attributes.each(*args, &block) end
find(name = nil)
click to toggle source
Shorthand for finding attributes by name.
Calls superclass method
# File lib/flickr/attributes.rb, line 176 def find(name = nil) if name super() { |attribute| attribute.name == name } else super() end end