Module: FMyLife

Defined in:
lib/fmylife.rb

Overview

See the individual docs for more examples.

Defined Under Namespace

Classes: Account, AuthenticationError, Comment, Developer, InvalidCategoryError, RetrievalError, Story, StoryTooLongError, UnsupportedParserError, VotingError, VotingTypeError

Constant Summary collapse

VERSION =
'0.5.1'
API_ROOT =
'api.betacie.com'
SANDBOX_ROOT =
'sandbox.betacie.com'
AVAILABLE_CATEGORIES =

Categories you are allowed to search and submit with

[ :love , :money , :kids , :work , :health , :sex , :miscellaneous ]
AVAILABLE_PARSERS =
[:nokogiri, :hpricot, :rexml, :libxml]

Class Method Summary collapse

Class Method Details

.parserObject



75
76
77
# File 'lib/fmylife.rb', line 75

def self.parser
  @@parser
end

.parser=(val) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fmylife.rb', line 61

def self.parser=(val)
  raise UnsupportedParserError.new("An unsupported parser was provided: #{val}") unless AVAILABLE_PARSERS.include? val
  @@parser = val
  case @@parser
  when :nokogiri
    require 'nokogiri'
  when :hpricot
    require 'hpricot'
  when :rexml
    require 'rexml/document'
  when :libxml
    require 'libxml'
  end
end