Class: SchemaTest::Property::UnresolvedProperty
- Inherits:
-
Object
- Object
- SchemaTest::Property
- Object
- SchemaTest::Property::UnresolvedProperty
- Defined in:
- lib/schema_test/property.rb
Constant Summary
Constants inherited from Object
Object::SHORTHAND_ATTRIBUTES, Object::TYPES
Constants inherited from SchemaTest::Property
Instance Attribute Summary
Attributes inherited from Object
#excluded_property_names, #version
Attributes inherited from SchemaTest::Property
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, versions:) ⇒ UnresolvedProperty
constructor
A new instance of UnresolvedProperty.
- #properties ⇒ Object
- #resolve ⇒ Object
Methods inherited from Object
#array, #as_json_schema, #base_json_schema_type, #based_on, #object
Methods inherited from SchemaTest::Property
#as_json_schema, #base_json_schema_type, #json_schema_format, #json_schema_type, #lookup_object, #nullable, #nullable!, #nullable?, #optional, #optional!, #optional?, #type
Constructor Details
#initialize(name, versions:) ⇒ UnresolvedProperty
Returns a new instance of UnresolvedProperty.
267 268 269 270 |
# File 'lib/schema_test/property.rb', line 267 def initialize(name, versions:) @name = name @versions = versions end |
Instance Method Details
#==(other) ⇒ Object
280 281 282 |
# File 'lib/schema_test/property.rb', line 280 def ==(other) resolve == other end |
#properties ⇒ Object
284 285 286 |
# File 'lib/schema_test/property.rb', line 284 def properties resolve.properties end |
#resolve ⇒ Object
272 273 274 275 276 277 278 |
# File 'lib/schema_test/property.rb', line 272 def resolve @versions.each do |v| definition = SchemaTest::Definition.find(@name, v) return definition if definition end raise SchemaTest::Error, "could not resolve schema #{@name.inspect}; tried versions: #{@versions.inspect}" end |