module Webspicy::Web

Constants

FORMALDOC

Public Class Methods

handle_finitio_error(ex) click to toggle source
# File lib/webspicy/web.rb, line 39
def handle_finitio_error(ex)
  puts ex.root_cause.message
  raise ex
end
service(raw, scope = Webspicy.default_scope) click to toggle source
# File lib/webspicy/web.rb, line 21
def service(raw, scope = Webspicy.default_scope)
  Webspicy.with_scope(scope) do
    FORMALDOC["Service"].dress(raw)
  end
rescue Finitio::Error => ex
  handle_finitio_error(ex)
end
specification(raw, file = nil, scope = Webspicy.default_scope) click to toggle source
# File lib/webspicy/web.rb, line 8
def specification(raw, file = nil, scope = Webspicy.default_scope)
  raw = YAML.load(raw) if raw.is_a?(String)
  Webspicy.with_scope(scope) do
    r = FORMALDOC["Specification"].dress(raw)
    r.config = scope.config
    r.located_at!(file) if file
    r
  end
rescue Finitio::Error => ex
  handle_finitio_error(ex)
end
test_case(raw, scope = Webspicy.default_scope) click to toggle source
# File lib/webspicy/web.rb, line 30
def test_case(raw, scope = Webspicy.default_scope)
  Webspicy.with_scope(scope) do
    FORMALDOC["TestCase"].dress(raw)
  end
rescue Finitio::Error => ex
  handle_finitio_error(ex)
end

Private Instance Methods

handle_finitio_error(ex) click to toggle source
# File lib/webspicy/web.rb, line 39
def handle_finitio_error(ex)
  puts ex.root_cause.message
  raise ex
end
service(raw, scope = Webspicy.default_scope) click to toggle source
# File lib/webspicy/web.rb, line 21
def service(raw, scope = Webspicy.default_scope)
  Webspicy.with_scope(scope) do
    FORMALDOC["Service"].dress(raw)
  end
rescue Finitio::Error => ex
  handle_finitio_error(ex)
end
specification(raw, file = nil, scope = Webspicy.default_scope) click to toggle source
# File lib/webspicy/web.rb, line 8
def specification(raw, file = nil, scope = Webspicy.default_scope)
  raw = YAML.load(raw) if raw.is_a?(String)
  Webspicy.with_scope(scope) do
    r = FORMALDOC["Specification"].dress(raw)
    r.config = scope.config
    r.located_at!(file) if file
    r
  end
rescue Finitio::Error => ex
  handle_finitio_error(ex)
end
test_case(raw, scope = Webspicy.default_scope) click to toggle source
# File lib/webspicy/web.rb, line 30
def test_case(raw, scope = Webspicy.default_scope)
  Webspicy.with_scope(scope) do
    FORMALDOC["TestCase"].dress(raw)
  end
rescue Finitio::Error => ex
  handle_finitio_error(ex)
end