Skip to content

Commit 813eb59

Browse files
committed
Delegate to Roar's represent w/o options argument
Small change that seems to grant us all of the niceties of Roar's represent for free
1 parent a941020 commit 813eb59

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/grape/roar/decorator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Grape
44
module Roar
55
class Decorator < ::Roar::Decorator
66
def self.represent(object, _options = {})
7-
new(object)
7+
super(object)
88
end
99
end
1010
end

lib/grape/roar/representer.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ module Grape
22
module Roar
33
module Representer
44
def self.included(base)
5+
super
6+
base.send(:include, Roar::Representer)
57
base.extend(ClassMethods)
68
end
79

810
module ClassMethods
911
def represent(object, _options = {})
10-
object.extend self
11-
object
12+
super(object)
1213
end
1314
end
1415
end

0 commit comments

Comments
 (0)