Class: Killbill::Plugin::Model::Tier

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTier

Returns a new instance of Tier.



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

def initialize()
end

Instance Attribute Details

#fixed_priceObject

Returns the value of attribute fixed_price.



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

def fixed_price
  @fixed_price
end

#limitsObject

Returns the value of attribute limits.



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

def limits
  @limits
end

#recurring_priceObject

Returns the value of attribute recurring_price.



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

def recurring_price
  @recurring_price
end

#tiered_blocksObject

Returns the value of attribute tiered_blocks.



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

def tiered_blocks
  @tiered_blocks
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
# File 'lib/killbill/gen/api/tier.rb', line 42

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

  # 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



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
95
96
97
98
# File 'lib/killbill/gen/api/tier.rb', line 69

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