Class: JsDuck::Process::Accessors

Inherits:
Object
  • Object
show all
Defined in:
lib/jsduck/process/accessors.rb

Overview

Expands accessors.

Looks up configs with @accessor tag (or configs defined inside config: {} or eventedConfig: {} block).

For such config “foo” it generates:

  • getter “getFoo”

  • setter “setFoo”

  • event “foochange” (when tagged with @evented)

Instance Method Summary collapse

Constructor Details

#initialize(classes) ⇒ Accessors

Returns a new instance of Accessors.



18
19
20
# File 'lib/jsduck/process/accessors.rb', line 18

def initialize(classes)
  @classes = classes
end

Instance Method Details

#process_all!Object

Generates accessors in all classes.



23
24
25
# File 'lib/jsduck/process/accessors.rb', line 23

def process_all!
  @classes.each_value {|cls| process(cls) }
end