Class: Alf::Predicate::Qualifier

Inherits:
Sexpr::Rewriter
  • Object
show all
Defined in:
lib/alf/predicate/processors/qualifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(qualifier) ⇒ Qualifier


7
8
9
# File 'lib/alf/predicate/processors/qualifier.rb', line 7

def initialize(qualifier)
  @qualifier = qualifier
end

Instance Attribute Details

#qualifierObject (readonly)

Returns the value of attribute qualifier


10
11
12
# File 'lib/alf/predicate/processors/qualifier.rb', line 10

def qualifier
  @qualifier
end

Instance Method Details

#on_identifier(sexpr) ⇒ Object


12
13
14
15
# File 'lib/alf/predicate/processors/qualifier.rb', line 12

def on_identifier(sexpr)
  return sexpr unless q = qualifier[sexpr.name]
  [:qualified_identifier, q, sexpr.name]
end

#on_native(sexpr) ⇒ Object

Raises:


17
18
19
# File 'lib/alf/predicate/processors/qualifier.rb', line 17

def on_native(sexpr)
  raise NotSupportedError
end