Class: SerpCheap::RankMatch

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

Returns the value of attribute link.



199
200
201
# File 'lib/serpcheap/models.rb', line 199

def link
  @link
end

#pageObject (readonly)

Returns the value of attribute page.



199
200
201
# File 'lib/serpcheap/models.rb', line 199

def page
  @page
end

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

#rankObject (readonly)

Returns the value of attribute rank.



199
200
201
# File 'lib/serpcheap/models.rb', line 199

def rank
  @rank
end

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