Class: Covalence::Context
- Inherits:
-
Object
- Object
- Covalence::Context
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/covalence/core/entities/context.rb
Overview
Maybe just call this targets
Instance Method Summary collapse
-
#initialize(attributes = {}, *args) ⇒ Context
constructor
A new instance of Context.
- #namespace ⇒ Object
- #to_command_options ⇒ Object
- #to_packer_command_options ⇒ Object
Constructor Details
#initialize(attributes = {}, *args) ⇒ Context
Returns a new instance of Context.
19 20 21 22 |
# File 'lib/covalence/core/entities/context.rb', line 19 def initialize(attributes = {}, *args) super self.valid? end |
Instance Method Details
#namespace ⇒ Object
24 25 26 27 |
# File 'lib/covalence/core/entities/context.rb', line 24 def namespace return "" if name.blank? "#{name}:" end |
#to_command_options ⇒ Object
29 30 31 |
# File 'lib/covalence/core/entities/context.rb', line 29 def values.map { |value| "-target=\"#{value}\"" } end |
#to_packer_command_options ⇒ Object
33 34 35 36 |
# File 'lib/covalence/core/entities/context.rb', line 33 def return "" if values.blank? "-only=#{values.join(',')}" end |