Class: Dato::JsonSchemaType

Inherits:
Object
  • Object
show all
Defined in:
lib/dato/json_schema_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#schemaObject (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

#callObject



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