Class: Pdi::Spoon::Options
- Inherits:
-
Object
- Object
- Pdi::Spoon::Options
- Defined in:
- lib/pdi/spoon/options.rb,
lib/pdi/spoon/options/arg.rb,
lib/pdi/spoon/options/level.rb,
lib/pdi/spoon/options/param.rb
Overview
This class serves as the input for executing a transformation or job through Pan or Kitchen.
Defined Under Namespace
Modules: Level, Type Classes: Arg, Param
Constant Summary collapse
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(level: Level::BASIC, name:, params: {}, repository:, type:) ⇒ Options
constructor
A new instance of Options.
- #to_args ⇒ Object
Constructor Details
#initialize(level: Level::BASIC, name:, params: {}, repository:, type:) ⇒ Options
Returns a new instance of Options.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/pdi/spoon/options.rb', line 35 def initialize( level: Level::BASIC, name:, params: {}, repository:, type: ) raise ArgumentError, 'name is required' if name.to_s.empty? raise ArgumentError, 'repository is required' if repository.to_s.empty? raise ArgumentError, 'type is required' if type.to_s.empty? @level = constant(Level, level) @name = name.to_s @params = params || {} @repository = repository.to_s @type = constant(Type, type) freeze end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
29 30 31 |
# File 'lib/pdi/spoon/options.rb', line 29 def level @level end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/pdi/spoon/options.rb', line 29 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
29 30 31 |
# File 'lib/pdi/spoon/options.rb', line 29 def params @params end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
29 30 31 |
# File 'lib/pdi/spoon/options.rb', line 29 def repository @repository end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
29 30 31 |
# File 'lib/pdi/spoon/options.rb', line 29 def type @type end |
Instance Method Details
#to_args ⇒ Object
55 56 57 |
# File 'lib/pdi/spoon/options.rb', line 55 def to_args base_args + param_args end |