Class: GoTransit::Metadata

Inherits:
ApiResource show all
Defined in:
lib/go_transit/resources/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApiResource

#initialize

Constructor Details

This class inherits a constructor from GoTransit::ApiResource

Instance Attribute Details

#error_codeObject

Returns the value of attribute error_code.



3
4
5
# File 'lib/go_transit/resources/metadata.rb', line 3

def error_code
  @error_code
end

#error_messageObject

Returns the value of attribute error_message.



3
4
5
# File 'lib/go_transit/resources/metadata.rb', line 3

def error_message
  @error_message
end

#time_stampObject

Returns the value of attribute time_stamp.



3
4
5
# File 'lib/go_transit/resources/metadata.rb', line 3

def time_stamp
  @time_stamp
end

Instance Method Details

#codeObject



9
10
11
# File 'lib/go_transit/resources/metadata.rb', line 9

def code
  error_code.to_i
end

#time_stamp_utcObject



13
14
15
# File 'lib/go_transit/resources/metadata.rb', line 13

def time_stamp_utc
  to_utc(time_stamp)
end

#to_sObject



5
6
7
# File 'lib/go_transit/resources/metadata.rb', line 5

def to_s
  "#{error_code} - #{error_message}"
end