Class: RubyAsterisk::ARI::Resources::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-asterisk/ari/resources/base.rb

Overview

Base class providing shared data access for ARI resource objects. Subclasses receive raw JSON data and a client reference, then expose domain-specific action methods that delegate HTTP calls to the client.

Direct Known Subclasses

Bridge, Channel, Endpoint, Playback

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, client) ⇒ Base

Returns a new instance of Base.



12
13
14
15
# File 'lib/ruby-asterisk/ari/resources/base.rb', line 12

def initialize(data, client)
  @data = data
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/ruby-asterisk/ari/resources/base.rb', line 10

def client
  @client
end

#dataObject (readonly)

Returns the value of attribute data.



10
11
12
# File 'lib/ruby-asterisk/ari/resources/base.rb', line 10

def data
  @data
end

Instance Method Details

#idObject



17
18
19
# File 'lib/ruby-asterisk/ari/resources/base.rb', line 17

def id
  data['id']
end