Class: TwitterCldr::Shared::DayPeriods::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/shared/day_periods.rb

Direct Known Subclasses

AtRule, FromRule

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, params) ⇒ Rule

Returns a new instance of Rule.



40
41
42
43
# File 'lib/twitter_cldr/shared/day_periods.rb', line 40

def initialize(name, params)
  @name = name
  @params = params
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



38
39
40
# File 'lib/twitter_cldr/shared/day_periods.rb', line 38

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.



38
39
40
# File 'lib/twitter_cldr/shared/day_periods.rb', line 38

def params
  @params
end

Class Method Details

.create(name, params) ⇒ Object



33
34
35
36
# File 'lib/twitter_cldr/shared/day_periods.rb', line 33

def self.create(name, params)
  return AtRule.new(name, params) if params.include?(:at)
  FromRule.new(name, params)
end