Class: SerpCheap::ScrapeStats

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:) ⇒ ScrapeStats

Returns a new instance of ScrapeStats.



162
163
164
165
# File 'lib/serpcheap/models.rb', line 162

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

Instance Attribute Details

#balanceObject (readonly)

Returns the value of attribute balance.



160
161
162
# File 'lib/serpcheap/models.rb', line 160

def balance
  @balance
end

#costObject (readonly)

Returns the value of attribute cost.



160
161
162
# File 'lib/serpcheap/models.rb', line 160

def cost
  @cost
end

Class Method Details

.from_hash(d) ⇒ Object



167
168
169
# File 'lib/serpcheap/models.rb', line 167

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