Skip to content

Commit 4836730

Browse files
authored
Merge pull request #5080 from amomchilov/use-attr_reader
Use `attr_reader` where applicable
2 parents a5e12e8 + fd0c3b4 commit 4836730

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

lib/graphql/schema/resolver.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,7 @@ def extensions
409409

410410
private
411411

412-
def own_extensions
413-
@own_extensions
414-
end
412+
attr_reader :own_extensions
415413
end
416414
end
417415
end

spec/graphql/analysis_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,7 @@ def on_enter_field(node, parent, visitor)
523523
super
524524
end
525525

526-
def result
527-
@result
528-
end
526+
attr_reader :result
529527
end
530528
class BaseField < GraphQL::Schema::Field
531529
def initialize(*args, visible: true, **kwargs, &block)

spec/graphql/tracing/statsd_trace_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ def time(key)
99
yield
1010
end
1111

12-
def timings
13-
@timings
14-
end
12+
attr_reader :timings
1513

1614
def clear
1715
@timings = []

spec/graphql/tracing/statsd_tracing_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ def time(key)
99
yield
1010
end
1111

12-
def timings
13-
@timings
14-
end
12+
attr_reader :timings
1513

1614
def clear
1715
@timings = []

0 commit comments

Comments
 (0)