Class: Killbill::Plugin::Model::PlanPhasePriceOverride
- Defined in:
- lib/killbill/gen/api/plan_phase_price_override.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#fixed_price ⇒ Object
Returns the value of attribute fixed_price.
-
#phase_name ⇒ Object
Returns the value of attribute phase_name.
-
#plan_phase_specifier ⇒ Object
Returns the value of attribute plan_phase_specifier.
-
#recurring_price ⇒ Object
Returns the value of attribute recurring_price.
-
#usage_price_overrides ⇒ Object
Returns the value of attribute usage_price_overrides.
Instance Method Summary collapse
-
#initialize ⇒ PlanPhasePriceOverride
constructor
A new instance of PlanPhasePriceOverride.
- #to_java ⇒ Object
- #to_ruby(j_obj) ⇒ Object
Constructor Details
#initialize ⇒ PlanPhasePriceOverride
Returns a new instance of PlanPhasePriceOverride.
39 40 |
# File 'lib/killbill/gen/api/plan_phase_price_override.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/plan_phase_price_override.rb', line 37 def currency @currency end |
#fixed_price ⇒ Object
Returns the value of attribute fixed_price.
37 38 39 |
# File 'lib/killbill/gen/api/plan_phase_price_override.rb', line 37 def fixed_price @fixed_price end |
#phase_name ⇒ Object
Returns the value of attribute phase_name.
37 38 39 |
# File 'lib/killbill/gen/api/plan_phase_price_override.rb', line 37 def phase_name @phase_name end |
#plan_phase_specifier ⇒ Object
Returns the value of attribute plan_phase_specifier.
37 38 39 |
# File 'lib/killbill/gen/api/plan_phase_price_override.rb', line 37 def plan_phase_specifier @plan_phase_specifier end |
#recurring_price ⇒ Object
Returns the value of attribute recurring_price.
37 38 39 |
# File 'lib/killbill/gen/api/plan_phase_price_override.rb', line 37 def recurring_price @recurring_price end |
#usage_price_overrides ⇒ Object
Returns the value of attribute usage_price_overrides.
37 38 39 |
# File 'lib/killbill/gen/api/plan_phase_price_override.rb', line 37 def usage_price_overrides @usage_price_overrides end |
Instance Method Details
#to_java ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/killbill/gen/api/plan_phase_price_override.rb', line 42 def to_java() # conversion for phase_name [type = java.lang.String] @phase_name = @phase_name.to_s unless @phase_name.nil? # conversion for plan_phase_specifier [type = org.killbill.billing.catalog.api.PlanPhaseSpecifier] @plan_phase_specifier = @plan_phase_specifier.to_java unless @plan_phase_specifier.nil? # 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 fixed_price [type = java.math.BigDecimal] if @fixed_price.nil? @fixed_price = java.math.BigDecimal::ZERO else @fixed_price = java.math.BigDecimal.new(@fixed_price.to_s) end # conversion for recurring_price [type = java.math.BigDecimal] if @recurring_price.nil? @recurring_price = java.math.BigDecimal::ZERO else @recurring_price = java.math.BigDecimal.new(@recurring_price.to_s) end # conversion for usage_price_overrides [type = java.util.List] tmp = java.util.ArrayList.new (@usage_price_overrides || []).each do |m| # conversion for m [type = org.killbill.billing.catalog.api.UsagePriceOverride] m = m.to_java unless m.nil? tmp.add(m) end @usage_price_overrides = tmp self end |
#to_ruby(j_obj) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/killbill/gen/api/plan_phase_price_override.rb', line 77 def to_ruby(j_obj) # conversion for phase_name [type = java.lang.String] @phase_name = j_obj.phase_name # conversion for plan_phase_specifier [type = org.killbill.billing.catalog.api.PlanPhaseSpecifier] @plan_phase_specifier = j_obj.plan_phase_specifier @plan_phase_specifier = Killbill::Plugin::Model::PlanPhaseSpecifier.new.to_ruby(@plan_phase_specifier) unless @plan_phase_specifier.nil? # 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 fixed_price [type = java.math.BigDecimal] @fixed_price = j_obj.fixed_price @fixed_price = @fixed_price.nil? ? 0 : BigDecimal.new(@fixed_price.to_s) # conversion for recurring_price [type = java.math.BigDecimal] @recurring_price = j_obj.recurring_price @recurring_price = @recurring_price.nil? ? 0 : BigDecimal.new(@recurring_price.to_s) # conversion for usage_price_overrides [type = java.util.List] @usage_price_overrides = j_obj.usage_price_overrides tmp = [] (@usage_price_overrides || []).each do |m| # conversion for m [type = org.killbill.billing.catalog.api.UsagePriceOverride] m = Killbill::Plugin::Model::UsagePriceOverride.new.to_ruby(m) unless m.nil? tmp << m end @usage_price_overrides = tmp self end |