Class: Eg::Book::DiscountGroup
- Inherits:
-
Object
- Object
- Eg::Book::DiscountGroup
- Defined in:
- lib/eg/book/discount_group_ordered_list.rb
Instance Attribute Summary collapse
-
#discount_percent ⇒ Object
readonly
Returns the value of attribute discount_percent.
-
#future_value ⇒ Object
readonly
Returns the value of attribute future_value.
-
#max_owing ⇒ Object
readonly
Returns the value of attribute max_owing.
-
#min_purchase ⇒ Object
readonly
Returns the value of attribute min_purchase.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(future_value, max_owing, min_purchase, discount_percent) ⇒ DiscountGroup
constructor
A new instance of DiscountGroup.
Constructor Details
#initialize(future_value, max_owing, min_purchase, discount_percent) ⇒ DiscountGroup
42 43 44 45 46 47 |
# File 'lib/eg/book/discount_group_ordered_list.rb', line 42 def initialize future_value, max_owing, min_purchase, discount_percent @future_value = future_value @max_owing = max_owing @min_purchase = min_purchase @discount_percent = discount_percent end |
Instance Attribute Details
#discount_percent ⇒ Object (readonly)
Returns the value of attribute discount_percent.
41 42 43 |
# File 'lib/eg/book/discount_group_ordered_list.rb', line 41 def discount_percent @discount_percent end |
#future_value ⇒ Object (readonly)
Returns the value of attribute future_value.
40 41 42 |
# File 'lib/eg/book/discount_group_ordered_list.rb', line 40 def future_value @future_value end |
#max_owing ⇒ Object (readonly)
Returns the value of attribute max_owing.
41 42 43 |
# File 'lib/eg/book/discount_group_ordered_list.rb', line 41 def max_owing @max_owing end |
#min_purchase ⇒ Object (readonly)
Returns the value of attribute min_purchase.
41 42 43 |
# File 'lib/eg/book/discount_group_ordered_list.rb', line 41 def min_purchase @min_purchase end |
Class Method Details
.get_elements ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/eg/book/discount_group_ordered_list.rb', line 48 def DiscountGroup.get_elements [ DiscountGroup.new('low', 0, 0, 0), DiscountGroup.new('low', 0, 2000, 3), DiscountGroup.new('medium', 500, 600, 3), DiscountGroup.new('medium', 0, 500, 5), DiscountGroup.new('high', 2000, 2000, 10) ] end |