Class: BoundioV2::TelStatus

Inherits:
Resource show all
Defined in:
lib/boundioV2/tel_status.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

api_version, create, exceptions, #initialize, request

Constructor Details

This class inherits a constructor from BoundioV2::Resource

Instance Attribute Details

#durationObject

Returns the value of attribute duration.



4
5
6
# File 'lib/boundioV2/tel_status.rb', line 4

def duration
  @duration
end

#endObject

Returns the value of attribute end.



4
5
6
# File 'lib/boundioV2/tel_status.rb', line 4

def end
  @end
end

#fromObject

Returns the value of attribute from.



4
5
6
# File 'lib/boundioV2/tel_status.rb', line 4

def from
  @from
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/boundioV2/tel_status.rb', line 4

def id
  @id
end

#startObject

Returns the value of attribute start.



4
5
6
# File 'lib/boundioV2/tel_status.rb', line 4

def start
  @start
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/boundioV2/tel_status.rb', line 4

def status
  @status
end

#toObject

Returns the value of attribute to.



4
5
6
# File 'lib/boundioV2/tel_status.rb', line 4

def to
  @to
end

Class Method Details

.find(id) ⇒ Object



6
7
8
9
# File 'lib/boundioV2/tel_status.rb', line 6

def find(id)
  res = request :get, "/tel_status", :tel_id => id
  parse(res["result"].first)
end

.find_all(options) ⇒ Object



11
12
13
14
# File 'lib/boundioV2/tel_status.rb', line 11

def find_all(options)
  res = request :get, "/tel_status", options
  res["result"].map {|h| parse(h)}
end

Instance Method Details

#processing?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/boundioV2/tel_status.rb', line 23

def processing?
  status == "架電待機"
end

#to_sObject



27
28
29
# File 'lib/boundioV2/tel_status.rb', line 27

def to_s
  "TelStatus (#{id}): #{from} -> #{to}, #{start} - #{self.end}, #{status}"
end