Class: Compel::Builder::Schema
- Inherits:
-
Object
- Object
- Compel::Builder::Schema
- Includes:
- Common
- Defined in:
- lib/compel/builder/schema.rb
Direct Known Subclasses
Any, Array, Boolean, Date, DateTime, Float, Hash, Integer, JSON, String, Time
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #default_value ⇒ Object
-
#initialize(type) ⇒ Schema
constructor
A new instance of Schema.
- #required? ⇒ Boolean
- #validate(object) ⇒ Object
Methods included from Common
#default, #is, #length, #max_length, #min_length, #required
Constructor Details
#initialize(type) ⇒ Schema
Returns a new instance of Schema.
11 12 13 14 |
# File 'lib/compel/builder/schema.rb', line 11 def initialize(type) @type = type @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/compel/builder/schema.rb', line 8 def @options end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/compel/builder/schema.rb', line 8 def type @type end |
Class Method Details
.human_name ⇒ Object
30 31 32 |
# File 'lib/compel/builder/schema.rb', line 30 def human_name "#{self.name.split('::')[1..-1].join('::')}" end |
Instance Method Details
#default_value ⇒ Object
20 21 22 |
# File 'lib/compel/builder/schema.rb', line 20 def default_value [:default] end |
#required? ⇒ Boolean
16 17 18 |
# File 'lib/compel/builder/schema.rb', line 16 def required? [:required] end |