Skip to content

Instantly share code, notes, and snippets.

@Samsinite
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Samsinite/5077b15a705e545058b1 to your computer and use it in GitHub Desktop.
Save Samsinite/5077b15a705e545058b1 to your computer and use it in GitHub Desktop.
class FooController
include ApiMe
model FooService
end
class FooService
def initialize(*args)
@foo = Foo.new(*args)
end
def method_missing(method, *args)
if @foo.respond_to?
@foo.send(method, *args)
else
super
end
end
def self.method_missing(method, *args)
if Foo.respond_to?
Foo.send(method, *args)
else
super
end
end
def save!(*args)
@foo.save!(*args)
# Do builder stuff here
end
def update!(*args)
@foo.update!(*args)
# Do any updated related builder stuff here
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment