Exception: NightTime::Jst::Build
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- NightTime::Jst::Build
- Defined in:
- lib/night-time/jst.rb
Overview
Builder
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#hour ⇒ Object
Returns the value of attribute hour.
-
#min ⇒ Object
Returns the value of attribute min.
-
#month ⇒ Object
Returns the value of attribute month.
-
#sec ⇒ Object
Returns the value of attribute sec.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
- #date? ⇒ Boolean
- #full? ⇒ Boolean
- #inspect ⇒ Object
- #time? ⇒ Boolean
- #to_a ⇒ Object
- #to_time ⇒ Object
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
21 22 23 |
# File 'lib/night-time/jst.rb', line 21 def day @day end |
#hour ⇒ Object
Returns the value of attribute hour.
21 22 23 |
# File 'lib/night-time/jst.rb', line 21 def hour @hour end |
#min ⇒ Object
Returns the value of attribute min.
21 22 23 |
# File 'lib/night-time/jst.rb', line 21 def min @min end |
#month ⇒ Object
Returns the value of attribute month.
21 22 23 |
# File 'lib/night-time/jst.rb', line 21 def month @month end |
#sec ⇒ Object
Returns the value of attribute sec.
21 22 23 |
# File 'lib/night-time/jst.rb', line 21 def sec @sec end |
#year ⇒ Object
Returns the value of attribute year.
21 22 23 |
# File 'lib/night-time/jst.rb', line 21 def year @year end |
Instance Method Details
#date? ⇒ Boolean
22 |
# File 'lib/night-time/jst.rb', line 22 def date?; month and day; end |
#full? ⇒ Boolean
24 |
# File 'lib/night-time/jst.rb', line 24 def full?; date? and time?; end |
#inspect ⇒ Object
27 |
# File 'lib/night-time/jst.rb', line 27 def inspect; "<Build: %s>" % [year,month,day,hour,min,sec].inspect; end |
#time? ⇒ Boolean
23 |
# File 'lib/night-time/jst.rb', line 23 def time?; hour and min; end |
#to_a ⇒ Object
25 |
# File 'lib/night-time/jst.rb', line 25 def to_a; [year, month, day, hour, min, sec]; end |
#to_time ⇒ Object
26 |
# File 'lib/night-time/jst.rb', line 26 def to_time; NightTime.mktime(year, month, day, hour||0, min||0, sec||0); end |