Class: Rapa::Price

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Price

Returns a new instance of Price.

Parameters:

  • source (Hash)


7
8
9
# File 'lib/rapa/price.rb', line 7

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceHash (readonly)

Returns:

  • (Hash)


4
5
6
# File 'lib/rapa/price.rb', line 4

def source
  @source
end

Instance Method Details

#amountInteger

Returns:

  • (Integer)


12
13
14
# File 'lib/rapa/price.rb', line 12

def amount
  source["Amount"].to_i
end

#currency_codeString

Returns:

  • (String)


17
18
19
# File 'lib/rapa/price.rb', line 17

def currency_code
  source["CurrencyCode"]
end

#formatted_priceString

Returns:

  • (String)


22
23
24
# File 'lib/rapa/price.rb', line 22

def formatted_price
  source["FormattedPrice"]
end