Class: Xrechnung::Currency
- Inherits:
-
Struct
- Object
- Struct
- Xrechnung::Currency
- Defined in:
- lib/xrechnung/currency.rb
Instance Attribute Summary collapse
-
#currency_id ⇒ Object
Returns the value of attribute currency_id.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#currency_id ⇒ Object
Returns the value of attribute currency_id
5 6 7 |
# File 'lib/xrechnung/currency.rb', line 5 def currency_id @currency_id end |
#value ⇒ Object
Returns the value of attribute value
5 6 7 |
# File 'lib/xrechnung/currency.rb', line 5 def value @value end |
Class Method Details
.EUR(value) ⇒ Object
16 17 18 19 20 |
# File 'lib/xrechnung/currency.rb', line 16 def EUR(value) raise ArgumentError, "value must respond to :to_d" unless value.respond_to? :to_d Currency.new(currency_id: "EUR", value: value.to_d) end |
Instance Method Details
#value_to_s ⇒ Object
6 7 8 |
# File 'lib/xrechnung/currency.rb', line 6 def value_to_s format("%0.2f", value) end |
#xml_args ⇒ Object
10 11 12 |
# File 'lib/xrechnung/currency.rb', line 10 def xml_args [value_to_s, { currencyID: currency_id }] end |