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

Returns a new instance of Field.



7
8
9
10
11
# File 'lib/slack/field.rb', line 7

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

Instance Attribute Details

#shortObject

Returns the value of attribute short.



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

def short
  @short
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#as_jsonObject



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

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