Module: ARST::Node

Defined in:
lib/arst/node.rb,
lib/arst/node/base.rb,
lib/arst/node/root.rb,
lib/arst/node/class.rb,
lib/arst/node/extend.rb,
lib/arst/node/module.rb,
lib/arst/node/include.rb,
lib/arst/node/namable.rb

Defined Under Namespace

Modules: Namable Classes: Base, Class, Extend, Include, Module, Root

Class Method Summary collapse

Class Method Details

.from_options(options) ⇒ Object

TODO: Rename to something more specific… from_raw_tree?



12
13
14
15
16
17
18
19
20
21
# File 'lib/arst/node.rb', line 12

def self.from_options(options)
  case options[:type]
  when 'module'  then Node::Module.new(options)
  when 'class'   then Node::Class.new(options)
  when 'extend'  then Node::Extend.new(options)
  when 'include' then Node::Include.new(options)
  else
    # TODO: Raise ARST::Error::InvalidNodeType
  end
end