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.8"
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.
18 19 20 |
# File 'lib/freckly.rb', line 18 def subdomain @subdomain end |
.token ⇒ Object
Returns the value of attribute token.
18 19 20 |
# File 'lib/freckly.rb', line 18 def token @token end |
Class Method Details
.authed_connection ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/freckly.rb', line 26 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
20 21 22 23 24 |
# File 'lib/freckly.rb', line 20 def authed_get(path, ={}) authed_connection.get do |request| request.url(path, ) end.body end |