Class: Flickr::Photos::License

Inherits:
Object
  • Object
show all
Defined in:
lib/flickr/license.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ License

create a new instance of a flickr photo license.

Params

  • attributes (Required)

    a hash of attributes used to set the initial values of the license object
    


9
10
11
12
13
# File 'lib/flickr/license.rb', line 9

def initialize(attributes)
  attributes.each do |k,v|
    send("#{k}=", v)
  end
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/flickr/license.rb', line 2

def id
  @id
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/flickr/license.rb', line 2

def name
  @name
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/flickr/license.rb', line 2

def url
  @url
end

Instance Method Details

#==(o) ⇒ Object



15
16
17
18
19
# File 'lib/flickr/license.rb', line 15

def == o
  return false unless o.respond_to?(:id) && o.respond_to?(:name) && o.respond_to?(:url)
  return true if id == o.id && name == o.name && url == o.url
  false
end

#eql?(o) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/flickr/license.rb', line 21

def eql? o
  return self == o
end