Sha256: 2b90197cd1d96108a72b2ab6e9ce58b2a26fd5f2e8786a8aa40c4fdc2050f80d

Contents?: true

Size: 252 Bytes

Versions: 40

Compression:

Stored size: 252 Bytes

Contents

class Price
  attr_accessor :cents, :currency, :dollars

  def initialize(hash)
    cents = hash['cents'].to_i
    @dollars = cents / 100
    @cents = cents % 100
    @currency = hash['currency']
  end

  def formatted_text
    "#{@dollars}"
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
quicktravel_client-4.7.0 lib/quick_travel/price.rb
quicktravel_client-4.6.0 lib/quick_travel/price.rb
quicktravel_client-4.5.0 lib/quick_travel/price.rb
quicktravel_client-4.4.0 lib/quick_travel/price.rb
quicktravel_client-4.3.2 lib/quick_travel/price.rb
quicktravel_client-4.3.1 lib/quick_travel/price.rb
quicktravel_client-4.3.0 lib/quick_travel/price.rb
quicktravel_client-4.2.0 lib/quick_travel/price.rb
quicktravel_client-4.1.0 lib/quick_travel/price.rb
quicktravel_client-4.0.0 lib/quick_travel/price.rb
quicktravel_client-3.9.0 lib/quick_travel/price.rb
quicktravel_client-3.8.1 lib/quick_travel/price.rb
quicktravel_client-3.8.0 lib/quick_travel/price.rb
quicktravel_client-1.1.2 lib/quick_travel/price.rb
quicktravel_client-3.7.0 lib/quick_travel/price.rb
quicktravel_client-3.6.1 lib/quick_travel/price.rb
quicktravel_client-3.6.0 lib/quick_travel/price.rb
quicktravel_client-3.5.0 lib/quick_travel/price.rb
quicktravel_client-3.4.0 lib/quick_travel/price.rb
quicktravel_client-3.3.0 lib/quick_travel/price.rb