Class: Field::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/field/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4
5
6
|
# File 'lib/field/base.rb', line 4
def name
@name
end
|
#translated ⇒ Object
Returns the value of attribute translated.
4
5
6
|
# File 'lib/field/base.rb', line 4
def translated
@translated
end
|
#type ⇒ Object
Returns the value of attribute type.
4
5
6
|
# File 'lib/field/base.rb', line 4
def type
@type
end
|
Class Method Details
.fetch(type) ⇒ Object
6
7
8
9
10
|
# File 'lib/field/base.rb', line 6
def self.fetch(type)
raise ::ArgumentError, "Unsupported type #{type}" unless supported_types.include?(type.to_sym)
"Field::Types::#{type.classify}".constantize.new
end
|
.supported_types ⇒ Object
20
21
22
|
# File 'lib/field/base.rb', line 20
def self.supported_types
[]
end
|
Instance Method Details
12
13
14
|
# File 'lib/field/base.rb', line 12
def json_schema_format
''
end
|
#json_schema_pattern ⇒ Object
24
25
26
|
# File 'lib/field/base.rb', line 24
def json_schema_pattern
''
end
|
#json_schema_type ⇒ Object
16
17
18
|
# File 'lib/field/base.rb', line 16
def json_schema_type
:string
end
|