Module: Dropmark
- Defined in:
- lib/dropmark.rb,
lib/dropmark/file.rb,
lib/dropmark/item.rb,
lib/dropmark/user.rb,
lib/dropmark/error.rb,
lib/dropmark/comment.rb,
lib/dropmark/version.rb,
lib/dropmark/collection.rb,
lib/dropmark/authentication.rb
Defined Under Namespace
Modules: Error Classes: Authentication, Collection, Comment, File, Item, User
Constant Summary collapse
- VERSION =
"0.1.5"
Class Attribute Summary collapse
-
.api_base ⇒ Object
Returns the value of attribute api_base.
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.user_id ⇒ Object
Returns the value of attribute user_id.
-
.user_token ⇒ Object
Returns the value of attribute user_token.
Class Method Summary collapse
Class Attribute Details
.api_base ⇒ Object
Returns the value of attribute api_base.
15 16 17 |
# File 'lib/dropmark.rb', line 15 def api_base @api_base end |
.api_key ⇒ Object
Returns the value of attribute api_key.
15 16 17 |
# File 'lib/dropmark.rb', line 15 def api_key @api_key end |
.user_id ⇒ Object
Returns the value of attribute user_id.
15 16 17 |
# File 'lib/dropmark.rb', line 15 def user_id @user_id end |
.user_token ⇒ Object
Returns the value of attribute user_token.
15 16 17 |
# File 'lib/dropmark.rb', line 15 def user_token @user_token end |
Class Method Details
.api ⇒ Object
18 19 20 |
# File 'lib/dropmark.rb', line 18 def self.api @api end |
.configure {|options| ... } ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dropmark.rb', line 22 def self.configure(&blk) = OpenStruct.new yield() @api_key = .try(:api_key) @api_base = .try(:api_base) || 'https://api.dropmark.com/v1' @user_id = .try(:user_id) @user_token = .try(:user_token) @api = Her::API.new @api.setup :url => @api_base do |c| c.use Faraday::Response::Logger c.use Dropmark::Authentication c.use Faraday::Request::Multipart c.use Faraday::Request::UrlEncoded c.use Her::Middleware::DefaultParseJSON c.use Faraday::Adapter::NetHttp c.use Dropmark::Error::RaiseError end require 'dropmark/collection' require 'dropmark/comment' require 'dropmark/item' require 'dropmark/user' end |