File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 66* [ #2573 ] ( https://github.com/ruby-grape/grape/pull/2573 ) : Clean up deprecated code - [ @ericproulx ] ( https://github.com/ericproulx ) .
77* [ #2575 ] ( https://github.com/ruby-grape/grape/pull/2575 ) : Refactor Api description class - [ @ericproulx ] ( https://github.com/ericproulx ) .
88* [ #2577 ] ( https://github.com/ruby-grape/grape/pull/2577 ) : Deprecate ` return ` in endpoint execution - [ @ericproulx ] ( https://github.com/ericproulx ) .
9- * [ #13 ] ( https://github.com/ericproulx/grape/pull/13 ) : Refactor endpoint helpers and error middleware integration - [ @ericproulx ] ( https://github.com/ericproulx ) .
9+ * [ #2580 ] ( https://github.com/ericproulx/grape/pull/2580 ) : Refactor endpoint helpers and error middleware integration - [ @ericproulx ] ( https://github.com/ericproulx ) .
10+ * [ #2581 ] ( https://github.com/ruby-grape/grape/pull/2581 ) : Delegate ` to_s ` in Grape::API::Instance - [ @ericproulx ] ( https://github.com/ericproulx ) .
1011* Your contribution here.
1112
1213#### Fixes
Original file line number Diff line number Diff line change @@ -19,11 +19,16 @@ class Instance
1919 Boolean = Grape ::API ::Boolean
2020
2121 class << self
22+ extend Forwardable
2223 attr_reader :instance , :base
2324 attr_accessor :configuration
2425
26+ def_delegators :base , :to_s
27+
2528 def given ( conditional_option , &block )
26- evaluate_as_instance_with_configuration ( block , lazy : true ) if conditional_option && block
29+ return unless conditional_option
30+
31+ mounted ( &block )
2732 end
2833
2934 def mounted ( &block )
@@ -35,10 +40,6 @@ def base=(grape_api)
3540 grape_api . instances << self
3641 end
3742
38- def to_s
39- base &.to_s || super
40- end
41-
4243 def base_instance?
4344 self == base . base_instance
4445 end
You can’t perform that action at this time.
0 commit comments