Class: Killbill::Plugin::Model::Price
- Defined in:
- lib/killbill/gen/api/price.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize ⇒ Price
constructor
A new instance of Price.
- #to_java ⇒ Object
- #to_ruby(j_obj) ⇒ Object
Constructor Details
#initialize ⇒ Price
Returns a new instance of Price.
39 40 |
# File 'lib/killbill/gen/api/price.rb', line 39 def initialize() end |
Instance Attribute Details
#currency ⇒ Object
Returns the value of attribute currency.
37 38 39 |
# File 'lib/killbill/gen/api/price.rb', line 37 def currency @currency end |
#value ⇒ Object
Returns the value of attribute value.
37 38 39 |
# File 'lib/killbill/gen/api/price.rb', line 37 def value @value end |
Instance Method Details
#to_java ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/killbill/gen/api/price.rb', line 42 def to_java() # conversion for currency [type = org.killbill.billing.catalog.api.Currency] @currency = Java::org.killbill.billing.catalog.api.Currency.value_of( @currency.to_s ) unless @currency.nil? # conversion for value [type = java.math.BigDecimal] if @value.nil? @value = java.math.BigDecimal::ZERO else @value = java.math.BigDecimal.new(@value.to_s) end self end |
#to_ruby(j_obj) ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/killbill/gen/api/price.rb', line 55 def to_ruby(j_obj) # conversion for currency [type = org.killbill.billing.catalog.api.Currency] @currency = j_obj.currency @currency = @currency.to_s.to_sym unless @currency.nil? # conversion for value [type = java.math.BigDecimal] @value = j_obj.value @value = @value.nil? ? 0 : BigDecimal.new(@value.to_s) self end |