Class: Bed::Schema
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
-
#initialize(fields) ⇒ Schema
constructor
A new instance of Schema.
- #pattern ⇒ Object
Constructor Details
#initialize(fields) ⇒ Schema
Returns a new instance of Schema.
22 23 24 |
# File 'lib/bed/definition.rb', line 22 def initialize(fields) @fields = fields end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
20 21 22 |
# File 'lib/bed/definition.rb', line 20 def fields @fields end |
Instance Method Details
#pattern ⇒ Object
26 27 28 |
# File 'lib/bed/definition.rb', line 26 def pattern fields.map { |_, v| v.is_a?(Schema) ? v.pattern : '_' }.join(', ') end |