class Seahorse::Model::Shapes::Timestamp

def format_time(time, default_format)

Returns:
  • (String) -

Parameters:
  • default_format (String) -- The format to default to
  • time (Time) --
def format_time(time, default_format)
  format = @format || default_format
  case format
  when 'iso8601'       then time.utc.iso8601
  when 'rfc822'        then time.utc.rfc822
  when 'httpdate'      then time.httpdate
  when 'unixTimestamp' then time.utc.to_i
  else
    msg = "invalid timestamp format #{format.inspect}"
    raise ArgumentError, msg
  end
end

def initialize(definition, options = {})

def initialize(definition, options = {})
  @format = definition['timestampFormat']
  super
end