Class: NeweggScraperChsbr::Price

Inherits:
Object
  • Object
show all
Defined in:
lib/newegg_scraper_chsbr/price.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(price) ⇒ Price

Returns a new instance of Price.



5
6
7
# File 'lib/newegg_scraper_chsbr/price.rb', line 5

def initialize(price)
    @price = price
end

Instance Attribute Details

#priceObject

Returns the value of attribute price.



3
4
5
# File 'lib/newegg_scraper_chsbr/price.rb', line 3

def price
  @price
end

Instance Method Details

#convert_priceObject



8
9
10
# File 'lib/newegg_scraper_chsbr/price.rb', line 8

def convert_price
    @price.slice(1 .. @price.size - 4).to_i
end