Class: Schema::Generators::ActionGenerator::Parameter
- Inherits:
-
Object
- Object
- Schema::Generators::ActionGenerator::Parameter
- Defined in:
- lib/generators/schema/action/action_generator.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
(also: #to_s)
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, options) ⇒ Parameter
constructor
A new instance of Parameter.
- #required? ⇒ Boolean
Constructor Details
#initialize(name, options) ⇒ Parameter
Returns a new instance of Parameter.
38 39 40 41 42 43 44 |
# File 'lib/generators/schema/action/action_generator.rb', line 38 def initialize(name, ) @name = name ||= [] @required = !!.delete(:required) @type = .shift || :string end |
Instance Attribute Details
#name ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute name.
35 36 37 |
# File 'lib/generators/schema/action/action_generator.rb', line 35 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
35 36 37 |
# File 'lib/generators/schema/action/action_generator.rb', line 35 def type @type end |
Instance Method Details
#required? ⇒ Boolean
46 47 48 |
# File 'lib/generators/schema/action/action_generator.rb', line 46 def required? @required end |