Class: BqGuess::Fields::Record
- Defined in:
- lib/bq_guess/fields/record.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Attributes inherited from Base
Instance Method Summary collapse
- #as_schema ⇒ Object
-
#initialize(name, fields) ⇒ Record
constructor
A new instance of Record.
- #to_hash ⇒ Object
Methods inherited from Base
#nullable!, #nullable?, #repeated!, #repeated?, #required!, #required?
Constructor Details
#initialize(name, fields) ⇒ Record
Returns a new instance of Record.
10 11 12 13 |
# File 'lib/bq_guess/fields/record.rb', line 10 def initialize(name, fields) super(name) @fields = fields end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
8 9 10 |
# File 'lib/bq_guess/fields/record.rb', line 8 def fields @fields end |
Instance Method Details
#as_schema ⇒ Object
15 16 17 |
# File 'lib/bq_guess/fields/record.rb', line 15 def as_schema super.merge(fields: fields.as_schema) end |
#to_hash ⇒ Object
19 20 21 |
# File 'lib/bq_guess/fields/record.rb', line 19 def to_hash super.merge(fields: fields.to_a) end |