Class: TempoIQ::Read

Inherits:
Object
  • Object
show all
Defined in:
lib/tempoiq/models/read.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#limitObject (readonly)

Returns the value of attribute limit.



3
4
5
# File 'lib/tempoiq/models/read.rb', line 3

def limit
  @limit
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/tempoiq/models/read.rb', line 3

def name
  @name
end

#startObject (readonly)

Returns the value of attribute start.



3
4
5
# File 'lib/tempoiq/models/read.rb', line 3

def start
  @start
end

#stopObject (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_hashObject



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