Class: Sidemash::Sdk::Timestamp
- Inherits:
-
Object
- Object
- Sidemash::Sdk::Timestamp
- Defined in:
- lib/sidemash/sdk/timestamp.rb
Instance Attribute Summary collapse
-
#seconds ⇒ Object
readonly
Returns the value of attribute seconds.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(seconds) ⇒ Timestamp
constructor
A new instance of Timestamp.
- #to_hash ⇒ Object
- #to_json(*a) ⇒ Object
- #to_remote ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(seconds) ⇒ Timestamp
Returns a new instance of Timestamp.
24 25 26 27 |
# File 'lib/sidemash/sdk/timestamp.rb', line 24 def initialize(seconds) @_type = 'Timestamp' @seconds = seconds end |
Instance Attribute Details
#seconds ⇒ Object (readonly)
Returns the value of attribute seconds.
22 23 24 |
# File 'lib/sidemash/sdk/timestamp.rb', line 22 def seconds @seconds end |
Class Method Details
._type ⇒ Object
29 30 31 |
# File 'lib/sidemash/sdk/timestamp.rb', line 29 def self._type 'Timestamp' end |
.from_hash(h) ⇒ Object
56 57 58 |
# File 'lib/sidemash/sdk/timestamp.rb', line 56 def self.from_hash(h) Timestamp.new(h['seconds']) end |
Instance Method Details
#to_hash ⇒ Object
45 46 47 48 49 50 |
# File 'lib/sidemash/sdk/timestamp.rb', line 45 def to_hash result = {} result[:_type] = @_type result[:seconds] = @seconds result end |
#to_json(*a) ⇒ Object
60 61 62 |
# File 'lib/sidemash/sdk/timestamp.rb', line 60 def to_json(*a) to_hash.to_json(*a) end |
#to_remote ⇒ Object
38 39 40 41 42 43 |
# File 'lib/sidemash/sdk/timestamp.rb', line 38 def to_remote result = {} result[:_type] = @_type result[:seconds] = @seconds result end |
#to_s ⇒ Object
64 65 66 |
# File 'lib/sidemash/sdk/timestamp.rb', line 64 def to_s 'Timestamp(seconds=' + @seconds + ')' end |