Class: SerpCheap::RankStats

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(balance:, cost:, pages_cached:, pages_fresh:) ⇒ RankStats

Returns a new instance of RankStats.



223
224
225
226
227
228
# File 'lib/serpcheap/models.rb', line 223

def initialize(balance:, cost:, pages_cached:, pages_fresh:)
  @balance = balance
  @cost = cost
  @pages_cached = pages_cached
  @pages_fresh = pages_fresh
end

Instance Attribute Details

#balanceObject (readonly)

Returns the value of attribute balance.



221
222
223
# File 'lib/serpcheap/models.rb', line 221

def balance
  @balance
end

#costObject (readonly)

Returns the value of attribute cost.



221
222
223
# File 'lib/serpcheap/models.rb', line 221

def cost
  @cost
end

#pages_cachedObject (readonly)

Returns the value of attribute pages_cached.



221
222
223
# File 'lib/serpcheap/models.rb', line 221

def pages_cached
  @pages_cached
end

#pages_freshObject (readonly)

Returns the value of attribute pages_fresh.



221
222
223
# File 'lib/serpcheap/models.rb', line 221

def pages_fresh
  @pages_fresh
end

Class Method Details

.from_hash(d) ⇒ Object



230
231
232
233
234
235
236
237
# File 'lib/serpcheap/models.rb', line 230

def self.from_hash(d)
  new(
    balance: d["balance"].to_i,
    cost: d["cost"].to_i,
    pages_cached: d["pages_cached"].to_i,
    pages_fresh: d["pages_fresh"].to_i
  )
end