File tree 2 files changed +3
-3
lines changed 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ def self.inherited(subclass)
133
133
# object = OpenStruct(awesomness: 'awesome_key', awesome: 'not-my-key', other: 'other-key' )
134
134
#
135
135
# class MyEntity < Grape::Entity
136
- # expose :awesome, as: Proc.new { object.awesomeness }
136
+ # expose :awesome, as: proc { object.awesomeness }
137
137
# expose :awesomeness, as: ->(object, opts) { object.other }
138
138
# end
139
139
#
Original file line number Diff line number Diff line change 33
33
end
34
34
35
35
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 }
37
37
expect ( subject . key ( entity ) ) . to eq ( model . name . reverse )
38
38
end
39
39
40
40
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 }
42
42
expect ( subject . key ( entity ) ) . to eq ( model . name . reverse )
43
43
end
44
44
end
You can’t perform that action at this time.
0 commit comments