Class: Slackoff::Post

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



44
45
46
# File 'lib/slackoff.rb', line 44

def channel
  @channel
end

#textObject

Returns the value of attribute text.



44
45
46
# File 'lib/slackoff.rb', line 44

def text
  @text
end

#usernameObject

Returns the value of attribute username.



44
45
46
# File 'lib/slackoff.rb', line 44

def username
  @username
end

Instance Method Details

#to_jsonObject



45
46
47
48
49
50
51
52
53
# File 'lib/slackoff.rb', line 45

def to_json
  body = {}

  body[:text] = @text if @text
  body[:channel] = @channel if @channel
  body[:username] = @username if @username

  body.to_json
end