Class: Deltacloud::Validation::Param
- Inherits:
-
Object
- Object
- Deltacloud::Validation::Param
- Defined in:
- lib/deltacloud/validation.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(args) ⇒ Param
constructor
A new instance of Param.
- #optional? ⇒ Boolean
- #required? ⇒ Boolean
Constructor Details
#initialize(args) ⇒ Param
Returns a new instance of Param.
36 37 38 39 40 41 42 |
# File 'lib/deltacloud/validation.rb', line 36 def initialize(args) @name = args[0] @klass = args[1] || :string @type = args[2] || :optional @options = args[3] || [] @description = args[4] || '' end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
34 35 36 |
# File 'lib/deltacloud/validation.rb', line 34 def description @description end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
34 35 36 |
# File 'lib/deltacloud/validation.rb', line 34 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
34 35 36 |
# File 'lib/deltacloud/validation.rb', line 34 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
34 35 36 |
# File 'lib/deltacloud/validation.rb', line 34 def @options end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
34 35 36 |
# File 'lib/deltacloud/validation.rb', line 34 def type @type end |
Instance Method Details
#optional? ⇒ Boolean
48 49 50 |
# File 'lib/deltacloud/validation.rb', line 48 def optional? type.eql?(:optional) end |
#required? ⇒ Boolean
44 45 46 |
# File 'lib/deltacloud/validation.rb', line 44 def required? type.eql?(:required) end |