Class: SexpBuilder::QueryBuilder::Scope

Inherits:
SexpPath::Matcher::Base
  • Object
show all
Defined in:
lib/sexp_builder/query_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, instance) ⇒ Scope

Returns a new instance of Scope.



18
19
20
21
# File 'lib/sexp_builder/query_builder.rb', line 18

def initialize(type, instance)
  @type = type
  @instance = instance
end

Instance Method Details

#satisfy?(o, data = {}) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'lib/sexp_builder/query_builder.rb', line 23

def satisfy?(o, data={})
  if @instance.scope[1..-1].include?(@type)
    capture_match o, data
  end
end