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.
128 129 130 |
# File 'lib/belt/cli/tables_command.rb', line 128 def initialize @fields = [] end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
126 127 128 |
# File 'lib/belt/cli/tables_command.rb', line 126 def fields @fields end |
Instance Method Details
#field(name, **opts) ⇒ Object
132 133 134 |
# File 'lib/belt/cli/tables_command.rb', line 132 def field(name, **opts) @fields << { name: name.to_s, type: opts[:type]&.to_s || 'string' } end |