Class: TwitterCldr::Shared::DayPeriods
- Inherits:
-
Object
- Object
- TwitterCldr::Shared::DayPeriods
- Includes:
- Singleton
- Defined in:
- lib/twitter_cldr/shared/day_periods.rb
Defined Under Namespace
Classes: AtRule, FromRule, Rule, Timestamp
Instance Attribute Summary collapse
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#rule_set ⇒ Object
readonly
Returns the value of attribute rule_set.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(locale, rule_set = :default) ⇒ DayPeriods
constructor
A new instance of DayPeriods.
- #period_type_for(time) ⇒ Object
Constructor Details
#initialize(locale, rule_set = :default) ⇒ DayPeriods
Returns a new instance of DayPeriods.
124 125 126 127 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 124 def initialize(locale, rule_set = :default) @locale = locale @rule_set = rule_set end |
Instance Attribute Details
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
116 117 118 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 116 def locale @locale end |
#rule_set ⇒ Object (readonly)
Returns the value of attribute rule_set.
116 117 118 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 116 def rule_set @rule_set end |
Class Method Details
.instance(locale) ⇒ Object
105 106 107 |
# File 'lib/twitter_cldr/shared/day_periods.rb', line 105 def instance(locale) instance_cache[locale] ||= new(locale) end |