Class: ZendeskAppsSupport::Manifest::LocationOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/zendesk_apps_support/manifest/location_options.rb

Constant Summary collapse

RUBY_TO_JSON =
{
  legacy: 'legacy',
  auto_load: 'autoLoad',
  auto_hide: 'autoHide',
  signed: 'signed',
  url: 'url'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location, options) ⇒ LocationOptions

Returns a new instance of LocationOptions.



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/zendesk_apps_support/manifest/location_options.rb', line 21

def initialize(location, options)
  @location = location

  RUBY_TO_JSON.each do |ruby, json|
    instance_variable_set(:"@#{ruby}", options[json])
  end
  @legacy ||= @url == ZendeskAppsSupport::Manifest::LEGACY_URI_STUB
  @auto_load = options.fetch('autoLoad', true)
  @auto_hide ||= false
  @signed ||= false
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



13
14
15
# File 'lib/zendesk_apps_support/manifest/location_options.rb', line 13

def location
  @location
end