Skip to content

Commit

Permalink
Merge pull request #5080 from amomchilov/use-attr_reader
Browse files Browse the repository at this point in the history
Use `attr_reader` where applicable
  • Loading branch information
rmosolgo authored Sep 2, 2024
2 parents a5e12e8 + fd0c3b4 commit 4836730
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions lib/graphql/schema/resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,7 @@ def extensions

private

def own_extensions
@own_extensions
end
attr_reader :own_extensions
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions spec/graphql/analysis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,7 @@ def on_enter_field(node, parent, visitor)
super
end

def result
@result
end
attr_reader :result
end
class BaseField < GraphQL::Schema::Field
def initialize(*args, visible: true, **kwargs, &block)
Expand Down
4 changes: 1 addition & 3 deletions spec/graphql/tracing/statsd_trace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ def time(key)
yield
end

def timings
@timings
end
attr_reader :timings

def clear
@timings = []
Expand Down
4 changes: 1 addition & 3 deletions spec/graphql/tracing/statsd_tracing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ def time(key)
yield
end

def timings
@timings
end
attr_reader :timings

def clear
@timings = []
Expand Down

0 comments on commit 4836730

Please sign in to comment.