Class: SFRest::Theme

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

Overview

Tell the Factory that there is theme work to do

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Theme

Returns a new instance of Theme.

Parameters:



7
8
9
# File 'lib/sfrest/theme.rb', line 7

def initialize(conn)
  @conn = conn
end

Instance Method Details

#process_theme_notification(sitegroup_id = 0) ⇒ Object

Processes a theme notification.



19
20
21
22
23
# File 'lib/sfrest/theme.rb', line 19

def process_theme_notification(sitegroup_id = 0)
  current_path = '/api/v1/theme/process'
  payload = { 'sitegroup_id' => sitegroup_id }.to_json
  @conn.post(current_path, payload)
end

#send_theme_notification(scope = 'site', event = 'modify', nid = 0, theme = '') ⇒ Object

Sends a theme notification.



12
13
14
15
16
# File 'lib/sfrest/theme.rb', line 12

def send_theme_notification(scope = 'site', event = 'modify', nid = 0, theme = '')
  current_path = '/api/v1/theme/notification'
  payload = { 'scope' => scope, 'event' => event, 'nid' => nid, 'theme' => theme }.to_json
  @conn.post(current_path, payload)
end