Class: LLRemote

Inherits:
Object
  • Object
show all
Defined in:
lib/l_l_remote.rb,
lib/l_l_remote/version.rb

Defined Under Namespace

Classes: Logi, Path, Step

Constant Summary collapse

VERSION =
'0.7.2'

Class Method Summary collapse

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(options = {})
  raise 'Needs :access_token' if options[:access_token].nil?

  LLRemote.access_token = options[:access_token]
  if options[:server_url]
    LLRemote.server_url = options[:server_url].gsub(/\/$/,'')
  else
    LLRemote.server_url = 'http://en.logilogi.org'
  end
  LLRemote::Path.setup
  LLRemote::Step.setup
end