Class: Killbill::Plugin::Model::SimplePlanDescriptor
- Defined in:
- lib/killbill/gen/api/simple_plan_descriptor.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#available_base_products ⇒ Object
Returns the value of attribute available_base_products.
-
#billing_period ⇒ Object
Returns the value of attribute billing_period.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#plan_id ⇒ Object
Returns the value of attribute plan_id.
-
#product_category ⇒ Object
Returns the value of attribute product_category.
-
#product_name ⇒ Object
Returns the value of attribute product_name.
-
#trial_length ⇒ Object
Returns the value of attribute trial_length.
-
#trial_time_unit ⇒ Object
Returns the value of attribute trial_time_unit.
Instance Method Summary collapse
-
#initialize ⇒ SimplePlanDescriptor
constructor
A new instance of SimplePlanDescriptor.
- #to_java ⇒ Object
- #to_ruby(j_obj) ⇒ Object
Constructor Details
#initialize ⇒ SimplePlanDescriptor
Returns a new instance of SimplePlanDescriptor.
39 40 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 39 def initialize() end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def amount @amount end |
#available_base_products ⇒ Object
Returns the value of attribute available_base_products.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def available_base_products @available_base_products end |
#billing_period ⇒ Object
Returns the value of attribute billing_period.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def billing_period @billing_period end |
#currency ⇒ Object
Returns the value of attribute currency.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def currency @currency end |
#plan_id ⇒ Object
Returns the value of attribute plan_id.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def plan_id @plan_id end |
#product_category ⇒ Object
Returns the value of attribute product_category.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def product_category @product_category end |
#product_name ⇒ Object
Returns the value of attribute product_name.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def product_name @product_name end |
#trial_length ⇒ Object
Returns the value of attribute trial_length.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def trial_length @trial_length end |
#trial_time_unit ⇒ Object
Returns the value of attribute trial_time_unit.
37 38 39 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 37 def trial_time_unit @trial_time_unit 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 76 77 78 79 80 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 42 def to_java() # conversion for plan_id [type = java.lang.String] @plan_id = @plan_id.to_s unless @plan_id.nil? # conversion for product_name [type = java.lang.String] @product_name = @product_name.to_s unless @product_name.nil? # conversion for product_category [type = org.killbill.billing.catalog.api.ProductCategory] @product_category = Java::org.killbill.billing.catalog.api.ProductCategory.value_of( @product_category.to_s ) unless @product_category.nil? # conversion for available_base_products [type = java.util.List] tmp = java.util.ArrayList.new (@available_base_products || []).each do |m| # conversion for m [type = java.lang.String] m = m.to_s unless m.nil? tmp.add(m) end @available_base_products = tmp # 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 amount [type = java.math.BigDecimal] if @amount.nil? @amount = java.math.BigDecimal::ZERO else @amount = java.math.BigDecimal.new(@amount.to_s) end # conversion for billing_period [type = org.killbill.billing.catalog.api.BillingPeriod] @billing_period = Java::org.killbill.billing.catalog.api.BillingPeriod.value_of( @billing_period.to_s ) unless @billing_period.nil? # conversion for trial_length [type = java.lang.Integer] @trial_length = @trial_length # conversion for trial_time_unit [type = org.killbill.billing.catalog.api.TimeUnit] @trial_time_unit = Java::org.killbill.billing.catalog.api.TimeUnit.value_of( @trial_time_unit.to_s ) unless @trial_time_unit.nil? self end |
#to_ruby(j_obj) ⇒ Object
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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/killbill/gen/api/simple_plan_descriptor.rb', line 82 def to_ruby(j_obj) # conversion for plan_id [type = java.lang.String] @plan_id = j_obj.plan_id # conversion for product_name [type = java.lang.String] @product_name = j_obj.product_name # conversion for product_category [type = org.killbill.billing.catalog.api.ProductCategory] @product_category = j_obj.product_category @product_category = @product_category.to_s.to_sym unless @product_category.nil? # conversion for available_base_products [type = java.util.List] @available_base_products = j_obj.available_base_products tmp = [] (@available_base_products || []).each do |m| # conversion for m [type = java.lang.String] tmp << m end @available_base_products = tmp # 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 amount [type = java.math.BigDecimal] @amount = j_obj.amount @amount = @amount.nil? ? 0 : BigDecimal.new(@amount.to_s) # conversion for billing_period [type = org.killbill.billing.catalog.api.BillingPeriod] @billing_period = j_obj.billing_period @billing_period = @billing_period.to_s.to_sym unless @billing_period.nil? # conversion for trial_length [type = java.lang.Integer] @trial_length = j_obj.trial_length # conversion for trial_time_unit [type = org.killbill.billing.catalog.api.TimeUnit] @trial_time_unit = j_obj.trial_time_unit @trial_time_unit = @trial_time_unit.to_s.to_sym unless @trial_time_unit.nil? self end |