Class: SolidusVolumePricing::RangeFromString
- Inherits:
-
Object
- Object
- SolidusVolumePricing::RangeFromString
- Defined in:
- lib/solidus_volume_pricing/range_from_string.rb
Constant Summary collapse
- RANGE_FORMAT =
/\A\(?(\d+)(\.{2,3})(\d+)\)?\z/.freeze
- OPEN_ENDED =
/\(?[0-9]+\+\)?/.freeze
Instance Attribute Summary collapse
-
#range_string ⇒ Object
readonly
Returns the value of attribute range_string.
Instance Method Summary collapse
-
#initialize(range_string) ⇒ RangeFromString
constructor
A new instance of RangeFromString.
- #to_range ⇒ Object
Constructor Details
#initialize(range_string) ⇒ RangeFromString
Returns a new instance of RangeFromString.
10 11 12 |
# File 'lib/solidus_volume_pricing/range_from_string.rb', line 10 def initialize(range_string) @range_string = range_string end |
Instance Attribute Details
#range_string ⇒ Object (readonly)
Returns the value of attribute range_string.
5 6 7 |
# File 'lib/solidus_volume_pricing/range_from_string.rb', line 5 def range_string @range_string end |
Instance Method Details
#to_range ⇒ Object
14 15 16 |
# File 'lib/solidus_volume_pricing/range_from_string.rb', line 14 def to_range ::Range.new(*) end |