Class: ZendeskAppsSupport::Installed

Inherits:
Object
  • Object
show all
Extended by:
Gem::Deprecate
Defined in:
lib/zendesk_apps_support/installed.rb

Constant Summary collapse

INSTALLED_TEMPLATE =
Erubis::Eruby.new(File.read(File.expand_path('../assets/installed.js.erb', __FILE__)))

Instance Method Summary collapse

Constructor Details

#initialize(appsjs, installations = []) ⇒ Installed

Returns a new instance of Installed.



9
10
11
12
# File 'lib/zendesk_apps_support/installed.rb', line 9

def initialize(appsjs, installations = [])
  @appsjs = appsjs
  @installations = installations
end

Instance Method Details

#compile(options = {}) ⇒ Object Also known as: compile_js



14
15
16
17
18
19
20
21
# File 'lib/zendesk_apps_support/installed.rb', line 14

def compile(options = {})
  INSTALLED_TEMPLATE.result(
    appsjs: @appsjs,
    installations: @installations,
    installation_orders: options.fetch(:installation_orders, {}),
    rollbar_zaf_access_token: options.fetch(:rollbar_zaf_access_token, '')
  )
end