Skip to content

Commit 6bc87c2

Browse files
author
James McCarthy
committed
All good with the cops.
1 parent 732f2e5 commit 6bc87c2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/grape_entity/entity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def self.inherited(subclass)
133133
# object = OpenStruct(awesomness: 'awesome_key', awesome: 'not-my-key', other: 'other-key' )
134134
#
135135
# class MyEntity < Grape::Entity
136-
# expose :awesome, as: Proc.new { object.awesomeness }
136+
# expose :awesome, as: proc { object.awesomeness }
137137
# expose :awesomeness, as: ->(object, opts) { object.other }
138138
# end
139139
#

spec/grape_entity/exposure_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
end
3434

3535
it 'returns the result if :as is a proc' do
36-
fresh_class.expose :name, as: Proc.new { object.name.reverse }
36+
fresh_class.expose :name, as: proc { object.name.reverse }
3737
expect(subject.key(entity)).to eq(model.name.reverse)
3838
end
3939

4040
it 'returns the result if :as is a lambda' do
41-
fresh_class.expose :name, as: ->(obj, opts) { obj.name.reverse }
41+
fresh_class.expose :name, as: ->(obj, _opts) { obj.name.reverse }
4242
expect(subject.key(entity)).to eq(model.name.reverse)
4343
end
4444
end

0 commit comments

Comments
 (0)