Exception: NightTime::Jst::Build

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/night-time/jst.rb

Overview

Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dayObject

Returns the value of attribute day.



21
22
23
# File 'lib/night-time/jst.rb', line 21

def day
  @day
end

#hourObject

Returns the value of attribute hour.



21
22
23
# File 'lib/night-time/jst.rb', line 21

def hour
  @hour
end

#minObject

Returns the value of attribute min.



21
22
23
# File 'lib/night-time/jst.rb', line 21

def min
  @min
end

#monthObject

Returns the value of attribute month.



21
22
23
# File 'lib/night-time/jst.rb', line 21

def month
  @month
end

#secObject

Returns the value of attribute sec.



21
22
23
# File 'lib/night-time/jst.rb', line 21

def sec
  @sec
end

#yearObject

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

Returns:

  • (Boolean)


22
# File 'lib/night-time/jst.rb', line 22

def date?; month and day; end

#full?Boolean

Returns:

  • (Boolean)


24
# File 'lib/night-time/jst.rb', line 24

def full?; date? and time?; end

#inspectObject



27
# File 'lib/night-time/jst.rb', line 27

def inspect; "<Build: %s>" % [year,month,day,hour,min,sec].inspect; end

#time?Boolean

Returns:

  • (Boolean)


23
# File 'lib/night-time/jst.rb', line 23

def time?; hour and min; end

#to_aObject



25
# File 'lib/night-time/jst.rb', line 25

def to_a; [year, month, day, hour, min, sec]; end

#to_timeObject



26
# File 'lib/night-time/jst.rb', line 26

def to_time; NightTime.mktime(year, month, day, hour||0, min||0, sec||0); end