class Esappend::Page

Public Class Methods

new(token, team_name, page_id) click to toggle source
# File lib/esappend.rb, line 6
def initialize(token, team_name, page_id)
  @token     = token
  @team_name = team_name
  @page_id   = page_id
end

Public Instance Methods

append(message) click to toggle source
# File lib/esappend.rb, line 12
def append(message)
  current_body = client.post(@page_id).body['body_md']

  post_body = current_body + "\r\n\r\n" + message
  client.update_post(@page_id, body_md: post_body)
end

Private Instance Methods

client() click to toggle source
# File lib/esappend.rb, line 21
def client
  @client ||= Esa::Client.new(access_token: @token, current_team: @team_name)
end