Class: WMLAction::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/wml_action/document.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Document

Returns a new instance of Document.



10
11
12
# File 'lib/wml_action/document.rb', line 10

def initialize(root)
  @root = root
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



8
9
10
# File 'lib/wml_action/document.rb', line 8

def root
  @root
end

Class Method Details

.from_file(filename) ⇒ Object



14
15
16
17
18
# File 'lib/wml_action/document.rb', line 14

def self.from_file(filename)
  root = Parser.new.parse_file(filename)
  #TODO file exceptions
  Document.new(root)
end