Class: Esappend::Page

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

Instance Method Summary collapse

Constructor Details

#initialize(token, team_name, page_id) ⇒ Page

Returns a new instance of Page.


6
7
8
9
10
# File 'lib/esappend.rb', line 6

def initialize(token, team_name, page_id)
  @token     = token
  @team_name = team_name
  @page_id   = page_id
end

Instance Method Details

#append(message) ⇒ Object


12
13
14
15
16
17
# 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