Class: CKSHCommander::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/cksh_commander/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text = "") ⇒ Response

Returns a new instance of Response.



5
6
7
8
9
# File 'lib/cksh_commander/response.rb', line 5

def initialize(text = "")
  @text = text
  @type = ""
  @attachments = []
end

Instance Attribute Details

#attachmentsObject

Returns the value of attribute attachments.



3
4
5
# File 'lib/cksh_commander/response.rb', line 3

def attachments
  @attachments
end

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/cksh_commander/response.rb', line 3

def text
  @text
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/cksh_commander/response.rb', line 3

def type
  @type
end

Instance Method Details

#serializeObject



11
12
13
14
15
16
17
# File 'lib/cksh_commander/response.rb', line 11

def serialize
  {
    text: @text,
    response_type: @type,
    attachments: @attachments
  }
end