Class: Slack::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/slack/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, value, short = false) ⇒ Field



5
6
7
8
9
# File 'lib/slack/field.rb', line 5

def initialize(title, value, short = false)
  @title = title
  @value = value
  @short = short
end

Instance Attribute Details

#shortObject

Returns the value of attribute short.



3
4
5
# File 'lib/slack/field.rb', line 3

def short
  @short
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/slack/field.rb', line 3

def title
  @title
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/slack/field.rb', line 3

def value
  @value
end

Instance Method Details

#as_jsonObject



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

def as_json
  {
    title: title,
    value: value,
    short: short
  }
end