Class: GoodGuide::Gibbon::JS

Inherits:
JSContext
  • Object
show all
Defined in:
lib/goodguide/gibbon.rb

Defined Under Namespace

Classes: Console

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ JS

Returns a new instance of JS.



448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/goodguide/gibbon.rb', line 448

def initialize(opts={})
  super()
  @debug = opts[:debug]

  self[:console] = Console.new

  if @debug
    load GoodGuide::Gibbon.dev_js_lib.to_s
  else
    load GoodGuide::Gibbon.js_lib.to_s
  end
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



447
448
449
# File 'lib/goodguide/gibbon.rb', line 447

def client
  @client
end

Class Method Details

.defaultObject



431
432
433
# File 'lib/goodguide/gibbon.rb', line 431

def self.default
  @default ||= new
end

Instance Method Details

#gibbonObject



461
462
463
# File 'lib/goodguide/gibbon.rb', line 461

def gibbon
  self[:Gibbon]
end