Class: UdonParser::UNode

Inherits:
Object
  • Object
show all
Defined in:
lib/udon/udon_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ UNode

Returns a new instance of UNode.



48
49
50
51
52
53
54
55
# File 'lib/udon/udon_parser.rb', line 48

def initialize(params={})
  @m = params.delete(:m) || UHash.new
  @m[:sline] ||= params.delete(:sline)
  @m[:schr] ||= params.delete(:schr)
  @a= params.delete(:a) || UHash.new
  @c= params.delete(:c) || []
  @name = params.delete(:name)
end

Instance Attribute Details

#aObject

Returns the value of attribute a.



47
48
49
# File 'lib/udon/udon_parser.rb', line 47

def a
  @a
end

#cObject

Returns the value of attribute c.



47
48
49
# File 'lib/udon/udon_parser.rb', line 47

def c
  @c
end

#mObject

Returns the value of attribute m.



47
48
49
# File 'lib/udon/udon_parser.rb', line 47

def m
  @m
end

#nameObject

Returns the value of attribute name.



47
48
49
# File 'lib/udon/udon_parser.rb', line 47

def name
  @name
end

Instance Method Details

#<<(val) ⇒ Object



58
# File 'lib/udon/udon_parser.rb', line 58

def <<(val) @c<<val end

#[](key) ⇒ Object



59
# File 'lib/udon/udon_parser.rb', line 59

def [](key) @c[key] end

#into(val) ⇒ Object



57
# File 'lib/udon/udon_parser.rb', line 57

def into(val) val << self end

#into!(val) ⇒ Object



56
# File 'lib/udon/udon_parser.rb', line 56

def into!(val) val << self end