Class: FlickrMocks::Models::CommonsInstitution

Inherits:
Object
  • Object
show all
Defined in:
lib/flickr_mocks/models/commons_institution.rb

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ CommonsInstitution

Returns a new instance of CommonsInstitution.



5
6
7
# File 'lib/flickr_mocks/models/commons_institution.rb', line 5

def initialize(object)
  self.delegated_to_object = object
end

Instance Method Details

#==(other) ⇒ Object

returns true if supplied object is equivalent to self



41
42
43
# File 'lib/flickr_mocks/models/commons_institution.rb', line 41

def ==(other)
  @delegated_to_object == other.instance_eval('@delegated_to_object')
end

#flickr_urlObject

returns flickr web address for the institution



26
27
28
# File 'lib/flickr_mocks/models/commons_institution.rb', line 26

def  flickr_url
  get_url(:flickr)
end

#initialize_copy(orig) ⇒ Object

compares value for internal state rather than object_id



46
47
48
49
# File 'lib/flickr_mocks/models/commons_institution.rb', line 46

def initialize_copy(orig) 
  super
  @delegated_to_object = @delegated_to_object.clone
end

#launch_dateObject

returns the launch date for the commons institution



10
11
12
# File 'lib/flickr_mocks/models/commons_institution.rb', line 10

def launch_date
  @delegated_to_object.date_launch
end

#license_urlObject

returns the url that describes the licensing



36
37
38
# File 'lib/flickr_mocks/models/commons_institution.rb', line 36

def license_url
  get_url(:license)
end

#owner_idObject Also known as: owner

returns the Owner id for the commons institution



15
16
17
# File 'lib/flickr_mocks/models/commons_institution.rb', line 15

def owner_id
  @delegated_to_object.nsid
end

#owner_nameObject

returns name of the commons institution



21
22
23
# File 'lib/flickr_mocks/models/commons_institution.rb', line 21

def owner_name
  @delegated_to_object.name
end

#site_urlObject

returns external web address for the institution



31
32
33
# File 'lib/flickr_mocks/models/commons_institution.rb', line 31

def site_url
  get_url(:site)
end