Class: VCAP::JsonSchema::HashSchema::Field
- Inherits:
-
Object
- Object
- VCAP::JsonSchema::HashSchema::Field
- Defined in:
- lib/vcap/json_schema.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#optional ⇒ Object
Returns the value of attribute optional.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(name, schema, optional = false) ⇒ Field
constructor
A new instance of Field.
Constructor Details
#initialize(name, schema, optional = false) ⇒ Field
Returns a new instance of Field.
106 107 108 109 110 111 |
# File 'lib/vcap/json_schema.rb', line 106 def initialize(name, schema, optional=false) raise ArgumentError, "Schema must be an instance of a schema, #{schema.class} given #{schema.inspect}" unless schema.kind_of?(BaseSchema) @name = name @schema = schema @optional = optional end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
103 104 105 |
# File 'lib/vcap/json_schema.rb', line 103 def name @name end |
#optional ⇒ Object
Returns the value of attribute optional.
104 105 106 |
# File 'lib/vcap/json_schema.rb', line 104 def optional @optional end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
103 104 105 |
# File 'lib/vcap/json_schema.rb', line 103 def schema @schema end |