Class: Twat::Endpoints::Identica

Inherits:
Base
  • Object
show all
Defined in:
lib/twat/endpoints/identica.rb

Instance Method Summary collapse

Methods inherited from Base

#authorize_account, #config

Constructor Details

#initializeIdentica

Returns a new instance of Identica.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/twat/endpoints/identica.rb', line 4

def initialize
  unless @@endpoint_set
    @@endpoint_set = true
    ::Twitter::Request.module_eval do
      alias :_request :request
      def request(method, path, params, options)
        path.gsub!(%r|^1/|, '')
        _request(method, path, params, options)
      end
    end
  end
end

Instance Method Details

#consumer_infoObject



26
27
28
29
30
31
# File 'lib/twat/endpoints/identica.rb', line 26

def consumer_info
  {
    consumer_key: "0af040d41599f5d07b738fc90a487af7",
    consumer_secret: "b6bb7284eaf975ab65a2dd3eb53fbf3d"
  }
end

#endpoint_nameObject



41
42
43
# File 'lib/twat/endpoints/identica.rb', line 41

def endpoint_name
  :"identi.ca"
end

#oauth_optionsObject



33
34
35
36
37
38
39
# File 'lib/twat/endpoints/identica.rb', line 33

def oauth_options
  {
    request_token_url: "https://identi.ca/api/oauth/request_token",
    access_token_url: "https://identi.ca/api/oauth/access_token",
    authorize_url: "https://identi.ca/api/oauth/authorize"
  }
end

#urlObject

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…



22
23
24
# File 'lib/twat/endpoints/identica.rb', line 22

def url
  "https://identi.ca/api"
end