Skip to content

Commit

Permalink
Delegate to Roar's represent w/o options argument
Browse files Browse the repository at this point in the history
Small change that seems to grant us all of the niceties of Roar's represent for free
  • Loading branch information
jcwilk committed Jun 9, 2016
1 parent a941020 commit ce70c06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/grape/roar/decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Grape
module Roar
class Decorator < ::Roar::Decorator
def self.represent(object, _options = {})
new(object)
super(object)
end
end
end
Expand Down
5 changes: 3 additions & 2 deletions lib/grape/roar/representer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ module Grape
module Roar
module Representer
def self.included(base)
super
base.send(:include, ::Roar::Representer)
base.extend(ClassMethods)
end

module ClassMethods
def represent(object, _options = {})
object.extend self
object
super(object)
end
end
end
Expand Down

0 comments on commit ce70c06

Please sign in to comment.