Class: Calagator::TimeRangeHelper::TimePart
- Inherits:
-
Object
- Object
- Calagator::TimeRangeHelper::TimePart
- Defined in:
- app/helpers/calagator/time_range_helper.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#parts ⇒ Object
readonly
Returns the value of attribute parts.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time, context, time_only: false, no_meridian: false, from_prefix: false) ⇒ TimePart
constructor
A new instance of TimePart.
- #to_s(format, which) ⇒ Object
Constructor Details
#initialize(time, context, time_only: false, no_meridian: false, from_prefix: false) ⇒ TimePart
Returns a new instance of TimePart.
67 68 69 70 71 72 73 74 75 |
# File 'app/helpers/calagator/time_range_helper.rb', line 67 def initialize(time, context, time_only: false, no_meridian: false, from_prefix: false) @time = time @context = context @parts = get_parts remove_parts_implied_by_context remove_day_parts if time_only remove_suffix if no_meridian set_at_to_from if from_prefix end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
77 78 79 |
# File 'app/helpers/calagator/time_range_helper.rb', line 77 def context @context end |
#parts ⇒ Object (readonly)
Returns the value of attribute parts.
77 78 79 |
# File 'app/helpers/calagator/time_range_helper.rb', line 77 def parts @parts end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
77 78 79 |
# File 'app/helpers/calagator/time_range_helper.rb', line 77 def time @time end |
Instance Method Details
#to_s(format, which) ⇒ Object
79 80 81 |
# File 'app/helpers/calagator/time_range_helper.rb', line 79 def to_s(format, which) TimePartRenderer.new(self, format, which).to_s end |