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',
  flexible: 'flexible',
  signed: 'signed',
  url: 'url',
  size: 'size'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location, options) ⇒ LocationOptions

Returns a new instance of LocationOptions.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/zendesk_apps_support/manifest/location_options.rb', line 24

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.



16
17
18
# File 'lib/zendesk_apps_support/manifest/location_options.rb', line 16

def location
  @location
end