Class: SerpCheap::Sitelink
- Inherits:
-
Object
- Object
- SerpCheap::Sitelink
- Defined in:
- lib/serpcheap/models.rb
Instance Attribute Summary collapse
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title:, link:) ⇒ Sitelink
constructor
A new instance of Sitelink.
Constructor Details
#initialize(title:, link:) ⇒ Sitelink
Returns a new instance of Sitelink.
7 8 9 10 |
# File 'lib/serpcheap/models.rb', line 7 def initialize(title:, link:) @title = title @link = link end |
Instance Attribute Details
#link ⇒ Object (readonly)
Returns the value of attribute link.
5 6 7 |
# File 'lib/serpcheap/models.rb', line 5 def link @link end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/serpcheap/models.rb', line 5 def title @title end |
Class Method Details
.from_hash(d) ⇒ Object
12 13 14 |
# File 'lib/serpcheap/models.rb', line 12 def self.from_hash(d) new(title: d["title"].to_s, link: d["link"].to_s) end |