Class: Tenios::API::CallDetailRecords

Inherits:
Object
  • Object
show all
Defined in:
lib/tenios/api/call_detail_records.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CallDetailRecords

Returns a new instance of CallDetailRecords.



8
9
10
# File 'lib/tenios/api/call_detail_records.rb', line 8

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/tenios/api/call_detail_records.rb', line 6

def client
  @client
end

Instance Method Details

#retrieve(date_range, page_size: 100) ⇒ Object



12
13
14
15
16
17
# File 'lib/tenios/api/call_detail_records.rb', line 12

def retrieve(date_range, page_size: 100)
  stream do |page|
    payload = build_payload(date_range, page: page, page_size: page_size)
    client.post("/cdrs/retrieve", **payload)
  end
end