Class: Killbill::Plugin::Model::UnitUsageRecord
- Defined in:
- lib/killbill/gen/api/unit_usage_record.rb
Instance Attribute Summary collapse
-
#daily_amount ⇒ Object
Returns the value of attribute daily_amount.
-
#unit_type ⇒ Object
Returns the value of attribute unit_type.
Instance Method Summary collapse
-
#initialize ⇒ UnitUsageRecord
constructor
A new instance of UnitUsageRecord.
- #to_java ⇒ Object
- #to_ruby(j_obj) ⇒ Object
Constructor Details
#initialize ⇒ UnitUsageRecord
Returns a new instance of UnitUsageRecord.
37 38 |
# File 'lib/killbill/gen/api/unit_usage_record.rb', line 37 def initialize() end |
Instance Attribute Details
#daily_amount ⇒ Object
Returns the value of attribute daily_amount.
35 36 37 |
# File 'lib/killbill/gen/api/unit_usage_record.rb', line 35 def daily_amount @daily_amount end |
#unit_type ⇒ Object
Returns the value of attribute unit_type.
35 36 37 |
# File 'lib/killbill/gen/api/unit_usage_record.rb', line 35 def unit_type @unit_type end |
Instance Method Details
#to_java ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/killbill/gen/api/unit_usage_record.rb', line 40 def to_java() # conversion for unit_type [type = java.lang.String] @unit_type = @unit_type.to_s unless @unit_type.nil? # conversion for daily_amount [type = java.util.List] tmp = java.util.ArrayList.new (@daily_amount || []).each do |m| # conversion for m [type = org.killbill.billing.usage.api.UsageRecord] m = m.to_java unless m.nil? tmp.add(m) end @daily_amount = tmp Java::org.killbill.billing.usage.api.UnitUsageRecord.new(@unit_type, @daily_amount) end |
#to_ruby(j_obj) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/killbill/gen/api/unit_usage_record.rb', line 55 def to_ruby(j_obj) # conversion for unit_type [type = java.lang.String] @unit_type = j_obj.unit_type # conversion for daily_amount [type = java.util.List] @daily_amount = j_obj.daily_amount tmp = [] (@daily_amount || []).each do |m| # conversion for m [type = org.killbill.billing.usage.api.UsageRecord] m = Killbill::Plugin::Model::UsageRecord.new.to_ruby(m) unless m.nil? tmp << m end @daily_amount = tmp self end |