Class: Shep::TimeBox

Inherits:
TypeBox show all
Defined in:
lib/shep/typeboxes.rb

Instance Method Summary collapse

Methods inherited from TypeBox

#==, #get, #initialize, #inspect, #set, #set?, #to_s, to_yard_s, #unset?

Constructor Details

This class inherits a constructor from Shep::TypeBox

Instance Method Details

#check(v) ⇒ Object



78
# File 'lib/shep/typeboxes.rb', line 78

def check(v) = assert_type(v, Time)

#get_for_jsonObject



82
# File 'lib/shep/typeboxes.rb', line 82

def get_for_json = set? ? @value.utc.iso8601(6) : nil

#set_from_json(v) ⇒ Object



79
80
81
# File 'lib/shep/typeboxes.rb', line 79

def set_from_json(v)
  set(Time.iso8601(v)) if v
end