Class: Foobara::CommandConnectors::ShCliConnector::InputsParser::Option::Model
- Inherits:
-
Option
- Object
- Option
- Foobara::CommandConnectors::ShCliConnector::InputsParser::Option::Model
- Defined in:
- foobara-sh-cli-connector-1.1.4/src/sh_cli_connector/inputs_parser/option/model.rb
Class Method Summary collapse
- .applicable?(attribute_type) ⇒ Boolean
- .attribute_to_options(attribute_name, attribute_type:, prefix:, is_required:, default:, always_prefix_inputs:) ⇒ Object
Class Method Details
.applicable?(attribute_type) ⇒ Boolean
8 9 10 |
# File 'src/sh_cli_connector/inputs_parser/option/model.rb', line 8 def applicable?(attribute_type) attribute_type.extends?(BuiltinTypes[:model]) && !attribute_type.extends?(BuiltinTypes[:entity]) end |
.attribute_to_options(attribute_name, attribute_type:, prefix:, is_required:, default:, always_prefix_inputs:) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'src/sh_cli_connector/inputs_parser/option/model.rb', line 12 def ( attribute_name, attribute_type:, prefix:, is_required:, default:, always_prefix_inputs: ) Option.( attribute_name, attribute_type: attribute_type.target_class.attributes_type, prefix:, is_required:, default:, always_prefix_inputs: ) end |