Class: Twilio::REST::Memory::V1::TraitInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/memory/v1/trait.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, store_id: nil, profile_id: nil) ⇒ TraitInstance

Initialize the TraitInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Trait resource.

  • sid (String)

    The SID of the Call resource to fetch.



281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 281

def initialize(version, payload , store_id: nil, profile_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'name' => payload['name'],
        'value' => payload['value'],
        'trait_group' => payload['trait_group'],
        'timestamp' => Twilio.deserialize_iso8601_datetime(payload['timestamp']),
    }
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



328
329
330
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 328

def inspect
    "<Twilio.Memory.V1.TraitInstance>"
end

#nameString

Returns The name of the trait.

Returns:

  • (String)

    The name of the trait.



298
299
300
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 298

def name
    @properties['name']
end

#timestampTime

Returns The time the trait was created or last updated.

Returns:

  • (Time)

    The time the trait was created or last updated.



316
317
318
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 316

def timestamp
    @properties['timestamp']
end

#to_sObject

Provide a user friendly representation



322
323
324
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 322

def to_s
    "<Twilio.Memory.V1.TraitInstance>"
end

#trait_groupString

Returns The trait group name to which this trait belongs.

Returns:

  • (String)

    The trait group name to which this trait belongs.



310
311
312
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 310

def trait_group
    @properties['trait_group']
end

#valueHash

Returns The value of a trait. Can be a string, integer, boolean, or an array of these types (arrays cannot contain nested arrays).

Returns:

  • (Hash)

    The value of a trait. Can be a string, integer, boolean, or an array of these types (arrays cannot contain nested arrays).



304
305
306
# File 'lib/twilio-ruby/rest/memory/v1/trait.rb', line 304

def value
    @properties['value']
end