Class: RazorRisk::Cassini::Applications::RESTFramework::VerbHandler

Inherits:
Object
  • Object
show all
Includes:
Pantheios, RazorRisk::Cassini::Authorisation::SecurityModelHelpers, Xqsr3::Quality::ParameterChecking
Defined in:
lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb

Overview

########################################################################## classes

Constant Summary collapse

HTTP_STATUS_NAMES =

########################################################## constants

::Rack::Utils::HTTP_STATUS_NAMES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RazorRisk::Cassini::Authorisation::SecurityModelHelpers

#razor_requester_credentials_options

Constructor Details

#initialize(app, settings = nil, **options) ⇒ VerbHandler

########################################################## methods



55
56
57
58
59
60
61
62
63
64
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 55

def initialize app, settings = nil, **options

    check_parameter app, 'app'

    settings    ||= app.class

    @app        =   app
    @settings   =   settings
    @options    =   options
end

Instance Attribute Details

#app ⇒ Object (readonly)

Returns the value of attribute app.



66
67
68
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 66

def app
  @app
end

#settings ⇒ Object (readonly)

Returns the value of attribute settings.



67
68
69
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 67

def settings
  @settings
end

Instance Method Details

#content_type(*args) ⇒ Object



69
70
71
72
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 69

def content_type *args

    @app.content_type(*args)
end

#error(*args) ⇒ Object



79
80
81
82
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 79

def error *args

    @app.error(*args)
end

#get_required_credentials ⇒ Object

Obtains a credentials-hash, which will be empty if no authentication is being used, or will contain :username and, optionally, :password and/or :domain, depending on the authentication scheme being used



93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 93

def get_required_credentials

    if settings.respond_to?(:authentication_scheme)

        razor_requester_credentials_options(
            settings.authentication_scheme,
            app.credentials,
            auth_test_mode: settings.auth_test_mode
        )
    else

        Hash.new
    end
end

#halt(*args) ⇒ Object



74
75
76
77
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 74

def halt *args

    @app.halt(*args)
end

#status(*args) ⇒ Object



84
85
86
87
# File 'lib/razor_risk/cassini/applications/rest_framework/verb_handler.rb', line 84

def status *args

    @app.status(*args)
end