Class: Twilio::REST::Content::V1::ContentList::CarouselCard

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/content/v1/content.rb,
lib/twilio-ruby/rest/content/v1/content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ CarouselCard

Returns a new instance of CarouselCard.



131
132
133
134
135
136
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 131

def initialize(payload)
        @title = payload["title"]
        @body = payload["body"]
        @media = payload["media"]
        @actions = payload["actions"]
end

Instance Attribute Details

#actions ⇒ Object

Parameters:

  • : (title) —

    [String]

  • : (body) —

    [String]

  • : (media) —

    [String]

  • : (actions) —

    [Array<ContentList.CarouselAction>]



130
131
132
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 130

def actions
  @actions
end

#body ⇒ Object

Parameters:

  • : (title) —

    [String]

  • : (body) —

    [String]

  • : (media) —

    [String]

  • : (actions) —

    [Array<ContentList.CarouselAction>]



130
131
132
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 130

def body
  @body
end

#media ⇒ Object

Parameters:

  • : (title) —

    [String]

  • : (body) —

    [String]

  • : (media) —

    [String]

  • : (actions) —

    [Array<ContentList.CarouselAction>]



130
131
132
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 130

def media
  @media
end

#title ⇒ Object

Parameters:

  • : (title) —

    [String]

  • : (body) —

    [String]

  • : (media) —

    [String]

  • : (actions) —

    [Array<ContentList.CarouselAction>]



130
131
132
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 130

def title
  @title
end

Instance Method Details

#to_json(options = {}) ⇒ Object



137
138
139
140
141
142
143
144
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 137

def to_json(options = {})
{
        "title": @title,
        "body": @body,
        "media": @media,
        "actions": @actions,
}.to_json(options)
end