Class: SerpCheap::RankMatch
- Inherits:
-
Object
- Object
- SerpCheap::RankMatch
- Defined in:
- lib/serpcheap/models.rb
Instance Attribute Summary collapse
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#position_on_page ⇒ Object
readonly
Returns the value of attribute position_on_page.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rank:, page:, position_on_page:, link:, title:) ⇒ RankMatch
constructor
A new instance of RankMatch.
Constructor Details
#initialize(rank:, page:, position_on_page:, link:, title:) ⇒ RankMatch
Returns a new instance of RankMatch.
201 202 203 204 205 206 207 |
# File 'lib/serpcheap/models.rb', line 201 def initialize(rank:, page:, position_on_page:, link:, title:) @rank = rank @page = page @position_on_page = position_on_page @link = link @title = title end |
Instance Attribute Details
#link ⇒ Object (readonly)
Returns the value of attribute link.
199 200 201 |
# File 'lib/serpcheap/models.rb', line 199 def link @link end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
199 200 201 |
# File 'lib/serpcheap/models.rb', line 199 def page @page end |
#position_on_page ⇒ Object (readonly)
Returns the value of attribute position_on_page.
199 200 201 |
# File 'lib/serpcheap/models.rb', line 199 def position_on_page @position_on_page end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
199 200 201 |
# File 'lib/serpcheap/models.rb', line 199 def rank @rank end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
199 200 201 |
# File 'lib/serpcheap/models.rb', line 199 def title @title end |
Class Method Details
.from_hash(d) ⇒ Object
209 210 211 212 213 214 215 216 217 |
# File 'lib/serpcheap/models.rb', line 209 def self.from_hash(d) new( rank: d["rank"].to_i, page: d["page"].to_i, position_on_page: d["position_on_page"].to_i, link: d["link"].to_s, title: d["title"].to_s ) end |