Class: ZendeskAppsSupport::Installed

Inherits:
Object
  • Object
show all
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.



7
8
9
10
# File 'lib/zendesk_apps_support/installed.rb', line 7

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

Instance Method Details

#compile_js(options = {}) ⇒ Object



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

def compile_js(options = {})
  installation_order = options.fetch(:installation_orders, {})

  INSTALLED_TEMPLATE.result(
    appsjs: @appsjs,
    installations: @installations,
    installation_orders: installation_order
  )
end