Class: Super::Schema
- Inherits:
-
Object
- Object
- Super::Schema
- Defined in:
- lib/super/schema.rb
Overview
The Schema is a general purpose container for describing the “schema” for various purposes. It primarily exists to provide a cohesive user-facing API for defining schemas.
The various “schema types” are likely of more interest
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
- #field_keys ⇒ Object
-
#initialize(schema_type) ⇒ Schema
constructor
A new instance of Schema.
Constructor Details
#initialize(schema_type) ⇒ Schema
Returns a new instance of Schema.
9 10 11 12 13 14 15 16 |
# File 'lib/super/schema.rb', line 9 def initialize(schema_type) @schema_type = schema_type @fields = {} if block_given? yield(@fields, @schema_type) end end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
18 19 20 |
# File 'lib/super/schema.rb', line 18 def fields @fields end |
Instance Method Details
#field_keys ⇒ Object
20 21 22 |
# File 'lib/super/schema.rb', line 20 def field_keys fields.keys end |