Class: WikibaseRepresentable::Model::SiteLink
- Inherits:
-
Object
- Object
- WikibaseRepresentable::Model::SiteLink
- Defined in:
- lib/wikibase_representable/model/site_link.rb
Overview
Value object representing a link to a page on another site.
Instance Attribute Summary collapse
-
#badges ⇒ Object
Returns the value of attribute badges.
-
#page_name ⇒ Object
Returns the value of attribute page_name.
-
#site_id ⇒ Object
Returns the value of attribute site_id.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(site_id: nil, page_name: nil, badges: nil) ⇒ SiteLink
constructor
A new instance of SiteLink.
- #state ⇒ Object
Constructor Details
#initialize(site_id: nil, page_name: nil, badges: nil) ⇒ SiteLink
Returns a new instance of SiteLink.
9 10 11 12 13 |
# File 'lib/wikibase_representable/model/site_link.rb', line 9 def initialize(site_id: nil, page_name: nil, badges: nil) @site_id = site_id @page_name = page_name @badges = badges end |
Instance Attribute Details
#badges ⇒ Object
Returns the value of attribute badges.
7 8 9 |
# File 'lib/wikibase_representable/model/site_link.rb', line 7 def badges @badges end |
#page_name ⇒ Object
Returns the value of attribute page_name.
7 8 9 |
# File 'lib/wikibase_representable/model/site_link.rb', line 7 def page_name @page_name end |
#site_id ⇒ Object
Returns the value of attribute site_id.
7 8 9 |
# File 'lib/wikibase_representable/model/site_link.rb', line 7 def site_id @site_id end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/wikibase_representable/model/site_link.rb', line 19 def ==(other) other.class == self.class && other.state == state end |
#eql?(other) ⇒ Boolean
23 24 25 |
# File 'lib/wikibase_representable/model/site_link.rb', line 23 def eql?(other) self == other end |
#state ⇒ Object
15 16 17 |
# File 'lib/wikibase_representable/model/site_link.rb', line 15 def state [site_id, page_name, badges] end |