Class | Amrita::AttrArray |
In: |
lib/amrita/compiler.rb
lib/amrita/node.rb lib/amrita/node_expand.rb |
Parent: | Object |
Array of Attr s. It can hold body part for using as a model data for Node#expand. Amrita#a() method is a shortcut for Attr.new
array | [R] | If you call a() { … }, block yields to body |
body | [R] | If you call a() { … }, block yields to body |
shared | [RW] |
internal use only, never touch it!
true if this instance is shared by two or more elements |
Don‘t use AttrArray.new use a() instead
# File lib/amrita/node.rb, line 94 def initialize(*attrs, &block) @array = [] @shared = false attrs.each do |a| case a when Array, AttrArray a.each do |aa| self << aa end when Hash attrs[0].each do |k, v| self << Attr.new(k, v) end else self << a end end if block_given? @body = yield else @body = Null end end
# File lib/amrita/node_expand.rb, line 258 def amrita_expand_node(n, context) raise Amrita::ModelMisMatch(type, n.type) end
# File lib/amrita/compiler.rb, line 58 def amrita_generate_hint if body Amrita::HtmlCompiler::AttrData[body.amrita_generate_hint] else Amrita::HtmlCompiler::AttrData.new end end