Class: Twilio::REST::Trusthub::V1::PoliciesContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/trusthub/v1/policies.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ PoliciesContext

Initialize the PoliciesContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique string that identifies the Policy resource.


148
149
150
151
152
153
154
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 148

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/Policies/#{@solution[:sid]}"
end

Instance Method Details

#fetchPoliciesInstance

Fetch the PoliciesInstance

Returns:


159
160
161
162
163
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 159

def fetch
  payload = @version.fetch('GET', @uri)

  PoliciesInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


174
175
176
177
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 174

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Trusthub.V1.PoliciesContext #{context}>"
end

#to_sObject

Provide a user friendly representation


167
168
169
170
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 167

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Trusthub.V1.PoliciesContext #{context}>"
end