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.
71 72 73 74 75 76 77 78 79 |
# File 'app/helpers/calagator/time_range_helper.rb', line 71 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.
81 82 83 |
# File 'app/helpers/calagator/time_range_helper.rb', line 81 def context @context end |
#parts ⇒ Object (readonly)
Returns the value of attribute parts.
81 82 83 |
# File 'app/helpers/calagator/time_range_helper.rb', line 81 def parts @parts end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
81 82 83 |
# File 'app/helpers/calagator/time_range_helper.rb', line 81 def time @time end |
Instance Method Details
#to_s(format, which) ⇒ Object
83 84 85 |
# File 'app/helpers/calagator/time_range_helper.rb', line 83 def to_s(format, which) TimePartRenderer.new(self, format, which).to_s end |