Class: Fabulator::Lib::Attribute

Inherits:
Structural
  • Object
show all
Defined in:
lib/fabulator/lib/attribute.rb

Instance Method Summary collapse

Methods inherited from Structural

#accepts_structural?, accepts_structural?, #compile_xml, contained_in, contains, element, #initialize, structurals

Constructor Details

This class inherits a constructor from Fabulator::Structural

Instance Method Details

#is_static?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/fabulator/lib/attribute.rb', line 12

def is_static?
  @static
end

#value(context) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/fabulator/lib/attribute.rb', line 16

def value(context)
  v = context.attribute(@ns, @name, { :static => @static, :eval => @eval, :inherited => @inherited })
  if @eval || !@static
    v = context.root.anon_node(v, [ FAB_NS, 'expression' ])
  end
  v
end