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.
170 171 172 |
# File 'lib/belt/cli/tables_command.rb', line 170 def initialize @fields = [] end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
168 169 170 |
# File 'lib/belt/cli/tables_command.rb', line 168 def fields @fields end |
Instance Method Details
#field(name, **opts) ⇒ Object
174 175 176 |
# File 'lib/belt/cli/tables_command.rb', line 174 def field(name, **opts) @fields << { name: name.to_s, type: opts[:type]&.to_s || 'string' } end |