Class: Covalence::Input
- Inherits:
-
Object
- Object
- Covalence::Input
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/covalence/core/entities/input.rb
Instance Method Summary collapse
-
#initialize(attributes = {}, *args) ⇒ Input
constructor
A new instance of Input.
- #to_command_hash_elements ⇒ Object
- #to_command_option ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(attributes = {}, *args) ⇒ Input
Returns a new instance of Input.
17 18 19 20 |
# File 'lib/covalence/core/entities/input.rb', line 17 def initialize(attributes = {}, *args) super self.valid? end |
Instance Method Details
#to_command_hash_elements ⇒ Object
31 32 33 |
# File 'lib/covalence/core/entities/input.rb', line 31 def to_command_hash_elements return name, parse_input(value()).delete_prefix('"').delete_suffix('"') end |
#to_command_option ⇒ Object
27 28 29 |
# File 'lib/covalence/core/entities/input.rb', line 27 def to_command_option "#{name} = #{parse_input(value())}" end |
#value ⇒ Object
22 23 24 25 |
# File 'lib/covalence/core/entities/input.rb', line 22 def value return raw_value if !raw_value.is_a?(Hash) get_value(raw_value) end |