Class: DataKit::Dataset::Schema
- Inherits:
-
Object
- Object
- DataKit::Dataset::Schema
- Defined in:
- lib/data_kit/dataset/schema.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
Instance Method Summary collapse
-
#initialize ⇒ Schema
constructor
A new instance of Schema.
- #keys ⇒ Object
- #to_yaml ⇒ Object
Constructor Details
#initialize ⇒ Schema
Returns a new instance of Schema.
8 9 10 |
# File 'lib/data_kit/dataset/schema.rb', line 8 def initialize @fields = [] end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
6 7 8 |
# File 'lib/data_kit/dataset/schema.rb', line 6 def fields @fields end |
Instance Method Details
#keys ⇒ Object
12 13 14 |
# File 'lib/data_kit/dataset/schema.rb', line 12 def keys fields.select{ |f| f.key? } end |
#to_yaml ⇒ Object
16 17 18 |
# File 'lib/data_kit/dataset/schema.rb', line 16 def to_yaml fields.collect(&:to_hash).to_yaml end |