Class: Restspec::Schema::Types::EmbeddedSchemaType
- Defined in:
- lib/restspec/schema/types/embedded_schema_type.rb
Instance Attribute Summary collapse
-
#schema_name ⇒ Object
Returns the value of attribute schema_name.
Instance Method Summary collapse
- #example_for(attribute) ⇒ Object
-
#initialize(options, options_when_name_is_present = {}) ⇒ EmbeddedSchemaType
constructor
A new instance of EmbeddedSchemaType.
- #valid?(attribute, value) ⇒ Boolean
Methods inherited from BasicType
Constructor Details
#initialize(options, options_when_name_is_present = {}) ⇒ EmbeddedSchemaType
Returns a new instance of EmbeddedSchemaType.
5 6 7 8 9 10 11 12 |
# File 'lib/restspec/schema/types/embedded_schema_type.rb', line 5 def initialize(, = {}) if .is_a?(Symbol) self.schema_name = super() else super() end end |
Instance Attribute Details
#schema_name ⇒ Object
Returns the value of attribute schema_name.
3 4 5 |
# File 'lib/restspec/schema/types/embedded_schema_type.rb', line 3 def schema_name @schema_name end |
Instance Method Details
#example_for(attribute) ⇒ Object
14 15 16 |
# File 'lib/restspec/schema/types/embedded_schema_type.rb', line 14 def example_for(attribute) Restspec::Schema::SchemaExample.new(schema).value end |
#valid?(attribute, value) ⇒ Boolean
18 19 20 |
# File 'lib/restspec/schema/types/embedded_schema_type.rb', line 18 def valid?(attribute, value) Restspec::Schema::Checker.new(schema).check!(value) end |