Class: TempoIQ::Read
- Inherits:
-
Object
- Object
- TempoIQ::Read
- Defined in:
- lib/tempoiq/models/read.rb
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#stop ⇒ Object
readonly
Returns the value of attribute stop.
Instance Method Summary collapse
-
#initialize(start, stop, limit = nil) ⇒ Read
constructor
A new instance of Read.
- #to_hash ⇒ Object
Constructor Details
#initialize(start, stop, limit = nil) ⇒ Read
Returns a new instance of Read.
5 6 7 8 9 10 |
# File 'lib/tempoiq/models/read.rb', line 5 def initialize(start, stop, limit = nil) @name = "read" @start = start @stop = stop @limit = limit end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
3 4 5 |
# File 'lib/tempoiq/models/read.rb', line 3 def limit @limit end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/tempoiq/models/read.rb', line 3 def name @name end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
3 4 5 |
# File 'lib/tempoiq/models/read.rb', line 3 def start @start end |
#stop ⇒ Object (readonly)
Returns the value of attribute stop.
3 4 5 |
# File 'lib/tempoiq/models/read.rb', line 3 def stop @stop end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/tempoiq/models/read.rb', line 12 def to_hash hash = { "start" => start.iso8601(3), "stop" => stop.iso8601(3) } hash["limit"] = limit if limit hash end |