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.
-
#parameter_overwite_by_rails_rule ⇒ Object
readonly
Boolean Options.
-
#params_key ⇒ Object
readonly
Non-boolean options:.
-
#parse_response_by_content_type ⇒ Object
readonly
Boolean Options.
-
#path_hash_key ⇒ Object
readonly
Non-boolean options:.
-
#prefix ⇒ Object
readonly
Non-boolean options:.
-
#query_hash_key ⇒ Object
readonly
Non-boolean options:.
-
#request_body_hash_key ⇒ 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.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/committee/schema_validator/option.rb', line 30 def initialize(, schema, schema_type) # Non-boolean options @headers_key = [:headers_key] || "committee.headers" @params_key = [:params_key] || "committee.params" @query_hash_key = [:query_hash_key] || "committee.query_hash" @path_hash_key = [:path_hash_key] || "committee.path_hash" @request_body_hash_key = [:request_body_hash_key] || "committee.request_body_hash" @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) @parse_response_by_content_type = .fetch(:parse_response_by_content_type, true) @parameter_overwite_by_rails_rule = .fetch(:parameter_overwite_by_rails_rule, true) # 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
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def allow_form_params @allow_form_params end |
#allow_get_body ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def allow_get_body @allow_get_body end |
#allow_query_params ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def allow_query_params @allow_query_params end |
#check_content_type ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def check_content_type @check_content_type end |
#check_header ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def check_header @check_header end |
#coerce_date_times ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def coerce_date_times @coerce_date_times end |
#coerce_form_params ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def coerce_form_params @coerce_form_params end |
#coerce_path_params ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def coerce_path_params @coerce_path_params end |
#coerce_query_params ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def coerce_query_params @coerce_query_params end |
#coerce_recursive ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def coerce_recursive @coerce_recursive end |
#headers_key ⇒ Object (readonly)
Non-boolean options:
23 24 25 |
# File 'lib/committee/schema_validator/option.rb', line 23 def headers_key @headers_key end |
#optimistic_json ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def optimistic_json @optimistic_json end |
#parameter_overwite_by_rails_rule ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def parameter_overwite_by_rails_rule @parameter_overwite_by_rails_rule end |
#params_key ⇒ Object (readonly)
Non-boolean options:
23 24 25 |
# File 'lib/committee/schema_validator/option.rb', line 23 def params_key @params_key end |
#parse_response_by_content_type ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def parse_response_by_content_type @parse_response_by_content_type end |
#path_hash_key ⇒ Object (readonly)
Non-boolean options:
23 24 25 |
# File 'lib/committee/schema_validator/option.rb', line 23 def path_hash_key @path_hash_key end |
#prefix ⇒ Object (readonly)
Non-boolean options:
23 24 25 |
# File 'lib/committee/schema_validator/option.rb', line 23 def prefix @prefix end |
#query_hash_key ⇒ Object (readonly)
Non-boolean options:
23 24 25 |
# File 'lib/committee/schema_validator/option.rb', line 23 def query_hash_key @query_hash_key end |
#request_body_hash_key ⇒ Object (readonly)
Non-boolean options:
23 24 25 |
# File 'lib/committee/schema_validator/option.rb', line 23 def request_body_hash_key @request_body_hash_key end |
#validate_success_only ⇒ Object (readonly)
Boolean Options
7 8 9 |
# File 'lib/committee/schema_validator/option.rb', line 7 def validate_success_only @validate_success_only end |