Class: Killbill::Plugin::Model::Usage

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/gen/api/usage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUsage

Returns a new instance of Usage.



39
40
# File 'lib/killbill/gen/api/usage.rb', line 39

def initialize()
end

Instance Attribute Details

#billing_modeObject

Returns the value of attribute billing_mode.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def billing_mode
  @billing_mode
end

#billing_periodObject

Returns the value of attribute billing_period.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def billing_period
  @billing_period
end

#blocksObject

Returns the value of attribute blocks.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def blocks
  @blocks
end

#fixed_priceObject

Returns the value of attribute fixed_price.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def fixed_price
  @fixed_price
end

#limitsObject

Returns the value of attribute limits.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def limits
  @limits
end

#nameObject

Returns the value of attribute name.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def name
  @name
end

#pretty_nameObject

Returns the value of attribute pretty_name.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def pretty_name
  @pretty_name
end

#recurring_priceObject

Returns the value of attribute recurring_price.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def recurring_price
  @recurring_price
end

#tier_block_policyObject

Returns the value of attribute tier_block_policy.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def tier_block_policy
  @tier_block_policy
end

#tiersObject

Returns the value of attribute tiers.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def tiers
  @tiers
end

#usage_typeObject

Returns the value of attribute usage_type.



37
38
39
# File 'lib/killbill/gen/api/usage.rb', line 37

def usage_type
  @usage_type
end

Instance Method Details

#to_javaObject



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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/killbill/gen/api/usage.rb', line 42

def to_java()
  # conversion for name [type = java.lang.String]
  @name = @name.to_s unless @name.nil?

  # conversion for pretty_name [type = java.lang.String]
  @pretty_name = @pretty_name.to_s unless @pretty_name.nil?

  # conversion for billing_mode [type = org.killbill.billing.catalog.api.BillingMode]
  @billing_mode = Java::org.killbill.billing.catalog.api.BillingMode.value_of( @billing_mode.to_s ) unless @billing_mode.nil?

  # conversion for usage_type [type = org.killbill.billing.catalog.api.UsageType]
  @usage_type = Java::org.killbill.billing.catalog.api.UsageType.value_of( @usage_type.to_s ) unless @usage_type.nil?

  # conversion for tier_block_policy [type = org.killbill.billing.catalog.api.TierBlockPolicy]
  @tier_block_policy = Java::org.killbill.billing.catalog.api.TierBlockPolicy.value_of( @tier_block_policy.to_s ) unless @tier_block_policy.nil?

  # 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 limits [type = org.killbill.billing.catalog.api.Limit[]]
  tmp = []
  (@limits || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Limit]
    m = m.to_java unless m.nil?
    tmp << m
  end
  @limits = tmp.to_java Java::org.killbill.billing.catalog.api.Limit

  # conversion for tiers [type = org.killbill.billing.catalog.api.Tier[]]
  tmp = []
  (@tiers || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Tier]
    m = m.to_java unless m.nil?
    tmp << m
  end
  @tiers = tmp.to_java Java::org.killbill.billing.catalog.api.Tier

  # conversion for blocks [type = org.killbill.billing.catalog.api.Block[]]
  tmp = []
  (@blocks || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Block]
    m = m.to_java unless m.nil?
    tmp << m
  end
  @blocks = tmp.to_java Java::org.killbill.billing.catalog.api.Block

  # conversion for fixed_price [type = org.killbill.billing.catalog.api.InternationalPrice]
  @fixed_price = @fixed_price.to_java unless @fixed_price.nil?

  # conversion for recurring_price [type = org.killbill.billing.catalog.api.InternationalPrice]
  @recurring_price = @recurring_price.to_java unless @recurring_price.nil?
  self
end

#to_ruby(j_obj) ⇒ Object



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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/killbill/gen/api/usage.rb', line 96

def to_ruby(j_obj)
  # conversion for name [type = java.lang.String]
  @name = j_obj.name

  # conversion for pretty_name [type = java.lang.String]
  @pretty_name = j_obj.pretty_name

  # conversion for billing_mode [type = org.killbill.billing.catalog.api.BillingMode]
  @billing_mode = j_obj.billing_mode
  @billing_mode = @billing_mode.to_s.to_sym unless @billing_mode.nil?

  # conversion for usage_type [type = org.killbill.billing.catalog.api.UsageType]
  @usage_type = j_obj.usage_type
  @usage_type = @usage_type.to_s.to_sym unless @usage_type.nil?

  # conversion for tier_block_policy [type = org.killbill.billing.catalog.api.TierBlockPolicy]
  @tier_block_policy = j_obj.tier_block_policy
  @tier_block_policy = @tier_block_policy.to_s.to_sym unless @tier_block_policy.nil?

  # 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 limits [type = org.killbill.billing.catalog.api.Limit[]]
  @limits = j_obj.limits
  tmp = []
  (@limits || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Limit]
    m = Killbill::Plugin::Model::Limit.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @limits = tmp

  # conversion for tiers [type = org.killbill.billing.catalog.api.Tier[]]
  @tiers = j_obj.tiers
  tmp = []
  (@tiers || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Tier]
    m = Killbill::Plugin::Model::Tier.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @tiers = tmp

  # conversion for blocks [type = org.killbill.billing.catalog.api.Block[]]
  @blocks = j_obj.blocks
  tmp = []
  (@blocks || []).each do |m|
    # conversion for m [type = org.killbill.billing.catalog.api.Block]
    m = Killbill::Plugin::Model::Block.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  @blocks = tmp

  # conversion for fixed_price [type = org.killbill.billing.catalog.api.InternationalPrice]
  @fixed_price = j_obj.fixed_price
  @fixed_price = Killbill::Plugin::Model::InternationalPrice.new.to_ruby(@fixed_price) unless @fixed_price.nil?

  # conversion for recurring_price [type = org.killbill.billing.catalog.api.InternationalPrice]
  @recurring_price = j_obj.recurring_price
  @recurring_price = Killbill::Plugin::Model::InternationalPrice.new.to_ruby(@recurring_price) unless @recurring_price.nil?
  self
end