Skip to content

Instantly share code, notes, and snippets.

@richo
Created October 20, 2011 08:18
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 richo/1300656 to your computer and use it in GitHub Desktop.
Save richo/1300656 to your computer and use it in GitHub Desktop.
module Twat::Endpoints
class Identica
def initialize
::Twitter.module_eval do
Request.module_eval do
def request(method, path, params, options)
path.gsub!(%r|^/1|, '')
super(method, path, params, options)
end
end
end
end
# this bails with /home/richo/code/ext/twat/lib/twat/endpoints/identica.rb:6:in `block in initialize': uninitialized constant Twat::Endpoints::Identica::Request (NameError)
# So I figured it's still relative to This module, so I tried
#
# ::Twitter.module_eval...
# but it bails with the same error
def url
"https://identi.ca/api"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment