Class: StructuredStore::RefResolvers::Base
- Inherits:
-
Object
- Object
- StructuredStore::RefResolvers::Base
- Defined in:
- lib/structured_store/ref_resolvers/base.rb
Overview
This is the base class for all JSON Schema $ref resolvers.
Direct Known Subclasses
BlankRefResolver, DefinitionsResolver, JsonDateRangeResolver
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#parent_schema ⇒ Object
readonly
Returns the value of attribute parent_schema.
-
#property_name ⇒ Object
readonly
Returns the value of attribute property_name.
-
#property_schema ⇒ Object
readonly
Returns the value of attribute property_schema.
-
#ref_string ⇒ Object
readonly
Returns the value of attribute ref_string.
Class Method Summary collapse
Instance Method Summary collapse
-
#define_attribute ⇒ Proc
abstract
Defines the rails attribute(s) on the given singleton class.
-
#initialize(property_schema, parent_schema, property_name, ref_string = '', context = {}) ⇒ Base
constructor
Initialize method for the base reference resolver.
-
#options_array ⇒ Array<Array>
abstract
Returns a two dimensional array of HTML select box options.
Constructor Details
#initialize(property_schema, parent_schema, property_name, ref_string = '', context = {}) ⇒ Base
Initialize method for the base reference resolver
34 35 36 37 38 39 40 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 34 def initialize(property_schema, parent_schema, property_name, ref_string = '', context = {}) @property_schema = property_schema @parent_schema = parent_schema @property_name = property_name @ref_string = ref_string @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 7 def context @context end |
#parent_schema ⇒ Object (readonly)
Returns the value of attribute parent_schema.
7 8 9 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 7 def parent_schema @parent_schema end |
#property_name ⇒ Object (readonly)
Returns the value of attribute property_name.
7 8 9 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 7 def property_name @property_name end |
#property_schema ⇒ Object (readonly)
Returns the value of attribute property_schema.
7 8 9 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 7 def property_schema @property_schema end |
#ref_string ⇒ Object (readonly)
Returns the value of attribute ref_string.
7 8 9 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 7 def ref_string @ref_string end |
Class Method Details
.matching_ref_pattern ⇒ Object
14 15 16 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 14 def matching_ref_pattern raise NotImplementedError, 'Subclasses must implement the matching_ref_pattern method' end |
.register ⇒ Object
18 19 20 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 18 def register StructuredStore::RefResolvers::Registry.register(self) end |
.unregister ⇒ Object
22 23 24 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 22 def unregister StructuredStore::RefResolvers::Registry.unregister(self) end |
Instance Method Details
#define_attribute ⇒ Proc
Subclasses must implement this method
Defines the rails attribute(s) on the given singleton class
47 48 49 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 47 def define_attribute raise NotImplementedError, 'Subclasses must implement the define_attribute method' end |
#options_array ⇒ Array<Array>
Subclasses must implement this method
Returns a two dimensional array of HTML select box options
This method must be implemented by subclasses to provide specific options for reference resolution.
59 60 61 |
# File 'lib/structured_store/ref_resolvers/base.rb', line 59 def raise NotImplementedError, 'Subclasses must implement the options_array method' end |