Class: Committee::SchemaValidator::Option
- Inherits:
-
Object
- Object
- Committee::SchemaValidator::Option
- Defined in:
- lib/committee/schema_validator/option.rb
Instance Attribute Summary collapse
-
#allow_form_params ⇒ Object
readonly
Boolean Options.
-
#allow_get_body ⇒ Object
readonly
Boolean Options.
-
#allow_query_params ⇒ Object
readonly
Boolean Options.
-
#check_content_type ⇒ Object
readonly
Boolean Options.
-
#check_header ⇒ Object
readonly
Boolean Options.
-
#coerce_date_times ⇒ Object
readonly
Boolean Options.
-
#coerce_form_params ⇒ Object
readonly
Boolean Options.
-
#coerce_path_params ⇒ Object
readonly
Boolean Options.
-
#coerce_query_params ⇒ Object
readonly
Boolean Options.
-
#coerce_recursive ⇒ Object
readonly
Boolean Options.
-
#headers_key ⇒ Object
readonly
Non-boolean options:.
-
#optimistic_json ⇒ Object
readonly
Boolean Options.
-
#params_key ⇒ Object
readonly
Non-boolean options:.
-
#prefix ⇒ Object
readonly
Non-boolean options:.
-
#validate_success_only ⇒ Object
readonly
Boolean Options.
Instance Method Summary collapse
-
#initialize(options, schema, schema_type) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(options, schema, schema_type) ⇒ Option
Returns a new instance of Option.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/committee/schema_validator/option.rb', line 22 def initialize(, schema, schema_type) # Non-boolean options @headers_key = [:headers_key] || "committee.headers" @params_key = [:params_key] || "committee.params" @prefix = [:prefix] # Boolean options and have a common value by default @allow_form_params = .fetch(:allow_form_params, true) @allow_query_params = .fetch(:allow_query_params, true) @check_content_type = .fetch(:check_content_type, true) @check_header = .fetch(:check_header, true) @coerce_recursive = .fetch(:coerce_recursive, true) @optimistic_json = .fetch(:optimistic_json, false) # Boolean options and have a different value by default @allow_get_body = .fetch(:allow_get_body, schema.driver.default_allow_get_body) @coerce_date_times = .fetch(:coerce_date_times, schema.driver.default_coerce_date_times) @coerce_form_params = .fetch(:coerce_form_params, schema.driver.default_coerce_form_params) @coerce_path_params = .fetch(:coerce_path_params, schema.driver.default_path_params) @coerce_query_params = .fetch(:coerce_query_params, schema.driver.default_query_params) @validate_success_only = .fetch(:validate_success_only, schema.driver.default_validate_success_only) end |
Instance Attribute Details
#allow_form_params ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def allow_form_params @allow_form_params end |
#allow_get_body ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def allow_get_body @allow_get_body end |
#allow_query_params ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def allow_query_params @allow_query_params end |
#check_content_type ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def check_content_type @check_content_type end |
#check_header ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def check_header @check_header end |
#coerce_date_times ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def coerce_date_times @coerce_date_times end |
#coerce_form_params ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def coerce_form_params @coerce_form_params end |
#coerce_path_params ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def coerce_path_params @coerce_path_params end |
#coerce_query_params ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def coerce_query_params @coerce_query_params end |
#coerce_recursive ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def coerce_recursive @coerce_recursive end |
#headers_key ⇒ Object (readonly)
Non-boolean options:
18 19 20 |
# File 'lib/committee/schema_validator/option.rb', line 18 def headers_key @headers_key end |
#optimistic_json ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def optimistic_json @optimistic_json end |
#params_key ⇒ Object (readonly)
Non-boolean options:
18 19 20 |
# File 'lib/committee/schema_validator/option.rb', line 18 def params_key @params_key end |
#prefix ⇒ Object (readonly)
Non-boolean options:
18 19 20 |
# File 'lib/committee/schema_validator/option.rb', line 18 def prefix @prefix end |
#validate_success_only ⇒ Object (readonly)
Boolean Options
4 5 6 |
# File 'lib/committee/schema_validator/option.rb', line 4 def validate_success_only @validate_success_only end |