Class: Dato::JsonSchemaType
- Inherits:
-
Object
- Object
- Dato::JsonSchemaType
- Defined in:
- lib/dato/json_schema_type.rb
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(schema) ⇒ JsonSchemaType
constructor
A new instance of JsonSchemaType.
Constructor Details
#initialize(schema) ⇒ JsonSchemaType
Returns a new instance of JsonSchemaType.
7 8 9 |
# File 'lib/dato/json_schema_type.rb', line 7 def initialize(schema) @schema = schema end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
5 6 7 |
# File 'lib/dato/json_schema_type.rb', line 5 def schema @schema end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/dato/json_schema_type.rb', line 11 def call type_property = find_info_for_type_property return nil unless type_property type_property.pattern.to_s.gsub(/(^(\(\?-mix:\^)|(\$\))$)/, "") end |