Class: Apipie::Generator::Swagger::Context
- Inherits:
-
Object
- Object
- Apipie::Generator::Swagger::Context
- Defined in:
- lib/apipie/generator/swagger/context.rb
Instance Attribute Summary collapse
-
#controller_method ⇒ Object
readonly
Returns the value of attribute controller_method.
-
#default_in_value ⇒ Object
readonly
Returns the value of attribute default_in_value.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
- #add_to_prefix!(prefix) ⇒ Object
- #allow_null? ⇒ Boolean
- #in_schema? ⇒ Boolean
-
#initialize(allow_null:, http_method:, controller_method:, prefix: nil, default_in_value: nil, language: nil, in_schema: true) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(allow_null:, http_method:, controller_method:, prefix: nil, default_in_value: nil, language: nil, in_schema: true) ⇒ Context
Returns a new instance of Context.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/apipie/generator/swagger/context.rb', line 5 def initialize( allow_null:, http_method:, controller_method:, prefix: nil, default_in_value: nil, language: nil, in_schema: true ) @default_in_value = default_in_value @allow_null = allow_null @language = language @in_schema = in_schema @http_method = http_method @controller_method = controller_method @prefix = prefix end |
Instance Attribute Details
#controller_method ⇒ Object (readonly)
Returns the value of attribute controller_method.
2 3 4 |
# File 'lib/apipie/generator/swagger/context.rb', line 2 def controller_method @controller_method end |
#default_in_value ⇒ Object (readonly)
Returns the value of attribute default_in_value.
2 3 4 |
# File 'lib/apipie/generator/swagger/context.rb', line 2 def default_in_value @default_in_value end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
2 3 4 |
# File 'lib/apipie/generator/swagger/context.rb', line 2 def http_method @http_method end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
2 3 4 |
# File 'lib/apipie/generator/swagger/context.rb', line 2 def language @language end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
2 3 4 |
# File 'lib/apipie/generator/swagger/context.rb', line 2 def prefix @prefix end |
Instance Method Details
#add_to_prefix!(prefix) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/apipie/generator/swagger/context.rb', line 31 def add_to_prefix!(prefix) @prefix = if @prefix.present? "#{@prefix}[#{prefix}]" else prefix end end |
#allow_null? ⇒ Boolean
23 24 25 |
# File 'lib/apipie/generator/swagger/context.rb', line 23 def allow_null? @allow_null == true end |
#in_schema? ⇒ Boolean
27 28 29 |
# File 'lib/apipie/generator/swagger/context.rb', line 27 def in_schema? @in_schema == true end |