Skip to content

Instantly share code, notes, and snippets.

@adammcarth
Created March 26, 2014 07:10
Show Gist options
  • Save adammcarth/9778133 to your computer and use it in GitHub Desktop.
Save adammcarth/9778133 to your computer and use it in GitHub Desktop.
module Get
def get()
# Code not necessary
end
end
class JTask
extend Get
end
JTask.get(blah)
#=> {"id" => 1, "name" => "John"}
# Currently, to get "name" you have to go:
JTask.get(blah)["name"] # yuck
#=> "John"
# I want to implement:
JTask.get(blah).name
#=> "John"
# Would I do this by using method_missing()?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment