Module: Leggy
- Includes:
- GemConfig::Base
- Defined in:
- lib/leggy.rb,
lib/leggy/app.rb,
lib/leggy/url.rb,
lib/leggy/user.rb,
lib/leggy/crawl.rb,
lib/leggy/error.rb,
lib/leggy/helpers.rb,
lib/leggy/version.rb,
lib/leggy/exceptions.rb,
lib/leggy/mapping/app.rb,
lib/leggy/mapping/url.rb,
lib/leggy/mapping/user.rb,
lib/leggy/resource/app.rb,
lib/leggy/resource/url.rb,
lib/leggy/crawl_options.rb,
lib/leggy/error_handler.rb,
lib/leggy/mapping/crawl.rb,
lib/leggy/resource/user.rb,
lib/leggy/resource/crawl.rb,
lib/leggy/resource/result.rb,
lib/leggy/mapping/crawl_options.rb
Defined Under Namespace
Modules: ErrorHandler, Exception, Helpers, Mapping, Resource Classes: App, Crawl, CrawlOptions, Error, Url, User
Constant Summary collapse
- VERSION =
"0.3.0"
Class Method Summary collapse
- .api_token ⇒ Object
-
.apps(options = {}) ⇒ Object
This resource allows for the uploading of 80app files.
- .connection ⇒ Object
- .connection=(value) ⇒ Object
-
.crawls(options = {}) ⇒ Object
This resource allows for the creation and cancelation of crawls.
-
.results(options = {}) ⇒ Object
This resource allows for viewing a list of the urls containing the crawl results.
- .setup(options) ⇒ Object
-
.urls(options = {}) ⇒ Object
This resource allows for the uploading and viewing of URL lists.
-
.users(options = {}) ⇒ Object
This resource allows for the viewing of user data.
Class Method Details
.api_token ⇒ Object
37 38 39 |
# File 'lib/leggy.rb', line 37 def self.api_token Base64.encode64("#{configuration.api_token}:") end |
.apps(options = {}) ⇒ Object
This resource allows for the uploading of 80app files.
65 66 67 |
# File 'lib/leggy.rb', line 65 def self.apps( = {}) Leggy::Resource::App.new(setup()) end |
.connection ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/leggy.rb', line 45 def self.connection Faraday.new( url: 'https://api.80legs.com', headers: { content_type: 'application/json', authorization: "Basic #{api_token}" } ) do |req| req.adapter :net_http end end |
.connection=(value) ⇒ Object
41 42 43 |
# File 'lib/leggy.rb', line 41 def self.connection=(value) @connection = value end |
.crawls(options = {}) ⇒ Object
This resource allows for the creation and cancelation of crawls. It also allows the user to view the crawl status and settings.
78 79 80 |
# File 'lib/leggy.rb', line 78 def self.crawls( = {}) Leggy::Resource::Crawl.new(setup()) end |
.results(options = {}) ⇒ Object
This resource allows for viewing a list of the urls containing the crawl results.
85 86 87 |
# File 'lib/leggy.rb', line 85 def self.results( = {}) Leggy::Resource::Result.new(setup()) end |
.setup(options) ⇒ Object
89 90 91 92 |
# File 'lib/leggy.rb', line 89 def self.setup() [:connection] = connection unless [:connection] end |