Class: SolidusVolumePricing::PriceDisplay
- Inherits:
-
Object
- Object
- SolidusVolumePricing::PriceDisplay
- Defined in:
- app/models/solidus_volume_pricing/price_display.rb
Instance Attribute Summary collapse
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
- #earning_amount_string ⇒ Object
- #earning_percent_string ⇒ Object
-
#initialize(variant, quantity: 1, user: nil) ⇒ PriceDisplay
constructor
A new instance of PriceDisplay.
- #price_string ⇒ Object
Constructor Details
#initialize(variant, quantity: 1, user: nil) ⇒ PriceDisplay
Returns a new instance of PriceDisplay.
7 8 9 10 11 |
# File 'app/models/solidus_volume_pricing/price_display.rb', line 7 def initialize(variant, quantity: 1, user: nil) @variant = variant @quantity = quantity @user = user end |
Instance Attribute Details
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
5 6 7 |
# File 'app/models/solidus_volume_pricing/price_display.rb', line 5 def quantity @quantity end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'app/models/solidus_volume_pricing/price_display.rb', line 5 def user @user end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
5 6 7 |
# File 'app/models/solidus_volume_pricing/price_display.rb', line 5 def variant @variant end |
Instance Method Details
#earning_amount_string ⇒ Object
17 18 19 |
# File 'app/models/solidus_volume_pricing/price_display.rb', line 17 def earning_amount_string earning_amount.to_s end |
#earning_percent_string ⇒ Object
21 22 23 |
# File 'app/models/solidus_volume_pricing/price_display.rb', line 21 def earning_percent_string earning_percent.to_s end |
#price_string ⇒ Object
13 14 15 |
# File 'app/models/solidus_volume_pricing/price_display.rb', line 13 def price_string price.to_s end |