Class: ReVIEW::BlockElementNode
- Defined in:
- lib/review/node.rb,
lib/review/compiler.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#compiler ⇒ Object
readonly
Returns the value of attribute compiler.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(compiler, position, name, args, content) ⇒ BlockElementNode
constructor
A new instance of BlockElementNode.
- #parse_args(*patterns) ⇒ Object
- #to_doc ⇒ Object
Methods inherited from Node
#inspect, #to_json, #to_raw, #to_s_by
Constructor Details
#initialize(compiler, position, name, args, content) ⇒ BlockElementNode
Returns a new instance of BlockElementNode.
879 880 881 882 883 884 885 |
# File 'lib/review/compiler.rb', line 879 def initialize(compiler, position, name, args, content) @compiler = compiler @position = position @name = name @args = args @content = content end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
889 890 891 |
# File 'lib/review/compiler.rb', line 889 def args @args end |
#compiler ⇒ Object (readonly)
Returns the value of attribute compiler.
886 887 888 |
# File 'lib/review/compiler.rb', line 886 def compiler @compiler end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
890 891 892 |
# File 'lib/review/compiler.rb', line 890 def content @content end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
888 889 890 |
# File 'lib/review/compiler.rb', line 888 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
887 888 889 |
# File 'lib/review/compiler.rb', line 887 def position @position end |
Instance Method Details
#parse_args(*patterns) ⇒ Object
90 91 92 93 94 95 96 97 98 |
# File 'lib/review/node.rb', line 90 def parse_args(*patterns) patterns.map.with_index do |pattern, i| if @args[i] @args[i].__send__("to_#{pattern}") else nil end end end |
#to_doc ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/review/node.rb', line 79 def to_doc # content_str = super args = @args.map(&:to_doc) if @content content_lines = @content.map(&:to_doc) else content_lines = nil end @compiler.compile_command(@name, @args, content_lines, self) end |