Class: Gupshup::REST::Api::V1

Inherits:
Version
  • Object
show all
Defined in:
lib/gupshup-rb/rest/api/v1.rb,
lib/gupshup-rb/rest/api/v1/message.rb

Defined Under Namespace

Classes: MessageList

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Api



8
9
10
11
12
# File 'lib/gupshup-rb/rest/api/v1.rb', line 8

def initialize(domain)
  super
  @version = 'v1'
  @solution = {}
end

Instance Method Details

#messages(sid = :unset) ⇒ Object

Raises:

  • (ArgumentError)


14
15
16
17
18
19
20
# File 'lib/gupshup-rb/rest/api/v1.rb', line 14

def messages(sid=:unset)
  raise ArgumentError, 'sid cannot be nil' if sid.nil?

  @messages = V1::MessageList.new(@version, src_name: @solution[:sid], )

  @messages
end

#to_sObject

Provide a user friendly representation



23
24
25
# File 'lib/gupshup-rb/rest/api/v1.rb', line 23

def to_s
  '<Gupshup::REST::Api::V1>'
end