Class: Time

Inherits:
Object show all
Defined in:
lib/ruby-fs-stack/enunciate/identity.rb,
lib/ruby-fs-stack/enunciate/familytree.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_json(o) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/ruby-fs-stack/enunciate/identity.rb', line 40

def self.from_json o
  if o.nil?
    return nil
  else
    return Time.at(o / 1000, (o % 1000) * 1000)
  end
end

Instance Method Details

#to_jaxb_json_hashObject

json time is represented as number of milliseconds since epoch



37
38
39
# File 'lib/ruby-fs-stack/enunciate/identity.rb', line 37

def to_jaxb_json_hash
  return (to_i * 1000) + (usec / 1000)
end