Exception: NightTime::Jst::Build

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dayObject

Returns the value of attribute day.



11
12
13
# File 'lib/night-time/jst.rb', line 11

def day
  @day
end

#hourObject

Returns the value of attribute hour.



11
12
13
# File 'lib/night-time/jst.rb', line 11

def hour
  @hour
end

#minObject

Returns the value of attribute min.



11
12
13
# File 'lib/night-time/jst.rb', line 11

def min
  @min
end

#monthObject

Returns the value of attribute month.



11
12
13
# File 'lib/night-time/jst.rb', line 11

def month
  @month
end

#secObject

Returns the value of attribute sec.



11
12
13
# File 'lib/night-time/jst.rb', line 11

def sec
  @sec
end

#yearObject

Returns the value of attribute year.



11
12
13
# File 'lib/night-time/jst.rb', line 11

def year
  @year
end

Instance Method Details

#date?Boolean

Returns:

  • (Boolean)


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

def date?; month and day; end

#full?Boolean

Returns:

  • (Boolean)


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

def full?; date? and time?; end

#inspectObject



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

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

#time?Boolean

Returns:

  • (Boolean)


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

def time?; hour and min; end

#to_arrayObject



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

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

#to_timeObject



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

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