Class: LLRemote
- Inherits:
-
Object
- Object
- LLRemote
- Defined in:
- lib/l_l_remote.rb,
lib/l_l_remote/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'0.7.2'
Class Method Summary collapse
-
.load_entry(link) ⇒ Object
Loads a ratom Atom::Entry for the given link.
-
.setup(options = {}) ⇒ Object
Sets the api-key and other options.
Class Method Details
.load_entry(link) ⇒ Object
Loads a ratom Atom::Entry for the given link.
For internal use.
56 57 58 59 60 61 62 63 |
# File 'lib/l_l_remote.rb', line 56 def self.load_entry(link) begin return Atom::Entry.load_entry(URI.parse(LLRemote.server_url + '/' + link + '/do.xml'), :read_timeout => 60) rescue raise 'Error: Can\'t load: ' + link + '. Perhaps wrong link ?' end end |
.setup(options = {}) ⇒ Object
Sets the api-key and other options.
Options:
-
access_token
= the API key, required -
server_url
= the logilogi server, defaults to en.logilogi.org
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/l_l_remote.rb', line 39 def self.setup( = {}) raise 'Needs :access_token' if [:access_token].nil? LLRemote.access_token = [:access_token] if [:server_url] LLRemote.server_url = [:server_url].gsub(/\/$/,'') else LLRemote.server_url = 'http://en.logilogi.org' end LLRemote::Path.setup LLRemote::Step.setup end |