Class: Twilio::REST::Assistants::V1::SessionContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Assistants::V1::SessionContext
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/session.rb
Instance Method Summary collapse
-
#fetch ⇒ SessionInstance
Fetch the SessionInstance.
-
#initialize(version, id) ⇒ SessionContext
constructor
Initialize the SessionContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messages ⇒ MessageList, MessageContext
Access the messages.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, id) ⇒ SessionContext
Initialize the SessionContext
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 136 def initialize(version, id) super(version) # Path Solution @solution = { id: id, } @uri = "/Sessions/#{@solution[:id]}" # Dependents @messages = nil end |
Instance Method Details
#fetch ⇒ SessionInstance
Fetch the SessionInstance
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 149 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) SessionInstance.new( @version, payload, id: @solution[:id], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
186 187 188 189 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 186 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.SessionContext #{context}>" end |
#messages ⇒ MessageList, MessageContext
Access the messages
169 170 171 172 173 174 175 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 169 def unless @messages @messages = MessageList.new( @version, ) end @messages end |
#to_s ⇒ Object
Provide a user friendly representation
179 180 181 182 |
# File 'lib/twilio-ruby/rest/assistants/v1/session.rb', line 179 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Assistants.V1.SessionContext #{context}>" end |