Module: Jarvis

Includes:
ActiveSupport::Configurable, HTTParty
Defined in:
lib/jarvis.rb,
lib/jarvis/cli.rb,
lib/jarvis/server.rb,
lib/jarvis/service.rb,
lib/jarvis/version.rb,
lib/jarvis/exceptions.rb,
lib/jarvis/interpreter.rb,
lib/jarvis/api/response.rb,
lib/jarvis/test_support/test_support.rb

Defined Under Namespace

Modules: API, TestSupport Classes: CLI, Exception, Interpreter, Server, Service, ThirdPartyAPIFailure, UnfitEnvironmentException

Constant Summary collapse

VERSION =
"0.1.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.servicesObject

Returns the value of attribute services.



25
26
27
# File 'lib/jarvis.rb', line 25

def services
  @services
end

Class Method Details

.clear_servicesObject



35
36
37
# File 'lib/jarvis.rb', line 35

def clear_services
  @services = []
end

.decode_uri(str) ⇒ Object



64
65
66
# File 'lib/jarvis.rb', line 64

def decode_uri(str)
  URI.decode(str)
end

.delete(path, options = {}, &block) ⇒ Object



56
57
58
# File 'lib/jarvis.rb', line 56

def delete(path, options={}, &block)
  Jarvis::API::Response.new HTTParty.delete(path, options, &block)
end

.encode_uri(str) ⇒ Object



60
61
62
# File 'lib/jarvis.rb', line 60

def encode_uri(str)
  URI.encode(str)
end

.get(path, options = {}, &block) ⇒ Object

HTTP Requests



40
41
42
# File 'lib/jarvis.rb', line 40

def get(path, options={}, &block)
  Jarvis::API::Response.new HTTParty.get(path, options, &block)
end

.patch(path, options = {}, &block) ⇒ Object



48
49
50
# File 'lib/jarvis.rb', line 48

def patch(path, options={}, &block)
  Jarvis::API::Response.new HTTParty.patch(path, options, &block)
end

.post(path, options = {}, &block) ⇒ Object



44
45
46
# File 'lib/jarvis.rb', line 44

def post(path, options={}, &block)
  Jarvis::API::Response.new HTTParty.post(path, options, &block)
end

.put(path, options = {}, &block) ⇒ Object



52
53
54
# File 'lib/jarvis.rb', line 52

def put(path, options={}, &block)
  Jarvis::API::Response.new HTTParty.put(path, options, &block)
end

.register_services(*args) ⇒ Object



30
31
32
33
# File 'lib/jarvis.rb', line 30

def register_services(*args)
  args.each { |klass| services << klass}
  Jarvis::Interpreter.build_determine_service
end