Class: JsonQuery::QueryMatchResults

Inherits:
Object
  • Object
show all
Defined in:
lib/json_query/query_match_results.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query:, paths: []) ⇒ QueryMatchResults



4
5
6
# File 'lib/json_query/query_match_results.rb', line 4

def initialize(query:, paths: [])
  @query, @paths = query, paths
end

Instance Attribute Details

#pathsObject (readonly)

Returns the value of attribute paths.



3
4
5
# File 'lib/json_query/query_match_results.rb', line 3

def paths
  @paths
end

#queryObject (readonly)

Returns the value of attribute query.



3
4
5
# File 'lib/json_query/query_match_results.rb', line 3

def query
  @query
end

Instance Method Details

#has_matching_paths?Boolean



8
9
10
# File 'lib/json_query/query_match_results.rb', line 8

def has_matching_paths?
  paths.any?
end