Class: SerpCheap::SearchStats

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:, cached:) ⇒ SearchStats

Returns a new instance of SearchStats.



117
118
119
120
121
# File 'lib/serpcheap/models.rb', line 117

def initialize(balance:, cost:, cached:)
  @balance = balance
  @cost = cost
  @cached = cached
end

Instance Attribute Details

#balanceObject (readonly)

Returns the value of attribute balance.



115
116
117
# File 'lib/serpcheap/models.rb', line 115

def balance
  @balance
end

#cachedObject (readonly)

Returns the value of attribute cached.



115
116
117
# File 'lib/serpcheap/models.rb', line 115

def cached
  @cached
end

#costObject (readonly)

Returns the value of attribute cost.



115
116
117
# File 'lib/serpcheap/models.rb', line 115

def cost
  @cost
end

Class Method Details

.from_hash(d) ⇒ Object



123
124
125
# File 'lib/serpcheap/models.rb', line 123

def self.from_hash(d)
  new(balance: d["balance"].to_i, cost: d["cost"].to_i, cached: d["cached"] == true)
end