Class: Muxi::Webhook::ContentItem

Inherits:
Struct
  • Object
show all
Defined in:
lib/muxi/webhook.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



17
18
19
# File 'lib/muxi/webhook.rb', line 17

def file
  @file
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



17
18
19
# File 'lib/muxi/webhook.rb', line 17

def text
  @text
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



17
18
19
# File 'lib/muxi/webhook.rb', line 17

def type
  @type
end

Class Method Details

.from_hash(data) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/muxi/webhook.rb', line 18

def self.from_hash(data)
  new(
    type: data["type"] || "text",
    text: data["text"],
    file: data["file"]
  )
end