Class: Amdapi::Call

Inherits:
Object show all
Defined in:
lib/amdapi/objects/call.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#method_missing, #respond_to_missing?

Constructor Details

#initialize(attr = {}, call_uuid: "", token: "") ⇒ Call

Returns a new instance of Call.



7
8
9
10
11
# File 'lib/amdapi/objects/call.rb', line 7

def initialize(attr = {}, call_uuid: "", token: "")
  super(attr)
  @call_uuid = call_uuid
  @token = token
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Amdapi::Object

Instance Attribute Details

#call_uuidObject (readonly)

Returns the value of attribute call_uuid.



5
6
7
# File 'lib/amdapi/objects/call.rb', line 5

def call_uuid
  @call_uuid
end

Instance Method Details

#refetch(adapter: Faraday.default_adapter, stubs: nil) ⇒ Object



13
14
15
16
17
# File 'lib/amdapi/objects/call.rb', line 13

def refetch(adapter: Faraday.default_adapter, stubs: nil)
  response = GetCall.new(call_uuid, @token, adapter, stubs).find
  @attributes = OpenStruct.new(response)
  true
end