Class: RSpec::GraphQLResponse::DigDug

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/graphql_response/dig_dug/dig_dug.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*dig_pattern) ⇒ DigDug

Returns a new instance of DigDug.



6
7
8
# File 'lib/rspec/graphql_response/dig_dug/dig_dug.rb', line 6

def initialize(*dig_pattern)
  @dig_pattern = parse_dig_pattern(*dig_pattern)
end

Instance Attribute Details

#dig_patternObject (readonly)

Returns the value of attribute dig_pattern.



4
5
6
# File 'lib/rspec/graphql_response/dig_dug/dig_dug.rb', line 4

def dig_pattern
  @dig_pattern
end

Instance Method Details

#dig(data) ⇒ Object



10
11
12
# File 'lib/rspec/graphql_response/dig_dug/dig_dug.rb', line 10

def dig(data)
  dig_data(data, dig_pattern)
end