Class: TwitterCldr::Shared::DayPeriods::AtRule

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

Instance Attribute Summary

Attributes inherited from Rule

#name, #params

Instance Method Summary collapse

Methods inherited from Rule

create, #initialize

Constructor Details

This class inherits a constructor from TwitterCldr::Shared::DayPeriods::Rule

Instance Method Details

#<=>(other) ⇒ Object



83
84
85
# File 'lib/twitter_cldr/shared/day_periods.rb', line 83

def <=>(other)
  -1
end

#atObject



91
92
93
94
95
# File 'lib/twitter_cldr/shared/day_periods.rb', line 91

def at
  @at ||= Timestamp.new(
    params[:at][:hour], params[:at][:min], 0
  )
end

#matches?(timestamp) ⇒ Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/twitter_cldr/shared/day_periods.rb', line 97

def matches?(timestamp)
  timestamp == at
end

#timespanObject



87
88
89
# File 'lib/twitter_cldr/shared/day_periods.rb', line 87

def timespan
  0
end