* remove trailing spaces. [ci skip]
This commit is contained in:
parent
9251971335
commit
78fb1ab84b
@ -11,23 +11,23 @@ module Indexer
|
|||||||
# field_name pairs so that they can be written back to the parent process.
|
# field_name pairs so that they can be written back to the parent process.
|
||||||
class Repository
|
class Repository
|
||||||
attr_reader :scope, :entries
|
attr_reader :scope, :entries
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@scope = []
|
@scope = []
|
||||||
@entries = []
|
@entries = []
|
||||||
end
|
end
|
||||||
|
|
||||||
def with(next_scope)
|
def with(next_scope)
|
||||||
previous_scope = scope
|
previous_scope = scope
|
||||||
@scope = scope + next_scope
|
@scope = scope + next_scope
|
||||||
yield
|
yield
|
||||||
@scope = previous_scope
|
@scope = previous_scope
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty?
|
def empty?
|
||||||
entries.empty?
|
entries.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
def enter(node_id, field_name)
|
def enter(node_id, field_name)
|
||||||
entries << [scope.join("::"), node_id, field_name]
|
entries << [scope.join("::"), node_id, field_name]
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user