Last active
August 29, 2015 14:13
-
-
Save Samsinite/5077b15a705e545058b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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