Class: Belt::CLI::TablesCommand::ModelParser
- Inherits:
-
Object
- Object
- Belt::CLI::TablesCommand::ModelParser
- Defined in:
- lib/belt/cli/tables_command.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
- #field(name, **opts) ⇒ Object
-
#initialize ⇒ ModelParser
constructor
A new instance of ModelParser.
Constructor Details
#initialize ⇒ ModelParser
Returns a new instance of ModelParser.
161 162 163 |
# File 'lib/belt/cli/tables_command.rb', line 161 def initialize @fields = [] end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
159 160 161 |
# File 'lib/belt/cli/tables_command.rb', line 159 def fields @fields end |
Instance Method Details
#field(name, **opts) ⇒ Object
165 166 167 |
# File 'lib/belt/cli/tables_command.rb', line 165 def field(name, **opts) @fields << { name: name.to_s, type: opts[:type]&.to_s || 'string' } end |