Class: SerpCheap::Sitelink

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Returns the value of attribute link.



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

def link
  @link
end

#titleObject (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