Module: Freckly
- Defined in:
- lib/freckly.rb,
lib/freckly/entry.rb,
lib/freckly/project.rb,
lib/freckly/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.0.3"
Class Attribute Summary collapse
-
.subdomain ⇒ Object
Returns the value of attribute subdomain.
-
.token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Class Attribute Details
.subdomain ⇒ Object
Returns the value of attribute subdomain.
15 16 17 |
# File 'lib/freckly.rb', line 15 def subdomain @subdomain end |
.token ⇒ Object
Returns the value of attribute token.
15 16 17 |
# File 'lib/freckly.rb', line 15 def token @token end |
Class Method Details
.authed_connection ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/freckly.rb', line 23 def authed_connection headers = { :user_agent => "Freckly", "X-FreckleToken" => token } @connection ||= Faraday::Connection.new(:url => "https://#{subdomain}.letsfreckle.com", :headers => headers, :ssl => {:verify => false}) do |builder| builder.adapter Faraday.default_adapter builder.use Faraday::Response::ParseXml builder.use Faraday::Response::Mashify end end |
.authed_get(path, options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/freckly.rb', line 17 def authed_get(path, ={}) authed_connection.get do |request| request.url(path, ) end.body end |