Class: Pipely::Definition
- Inherits:
-
Object
- Object
- Pipely::Definition
- Defined in:
- lib/pipely/definition.rb
Overview
Pipely’s representation of a Pipeline Definition for AWS Data Pipeline amzn.to/1bpW8Ru
Constant Summary collapse
- NON_GRAPH_COMPONENT_TYPES =
Showing all component types leads to an unwieldy graph. TODO: make this list configurable.
[ 'Schedule', 'SnsAlarm', 'Ec2Resource', 'EmrCluster', 'CSV', nil, ]
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
Class Method Summary collapse
Instance Method Summary collapse
- #apply_component_attributes(component_attributes) ⇒ Object
- #components_for_graph ⇒ Object
-
#initialize(components) ⇒ Definition
constructor
A new instance of Definition.
- #to_json ⇒ Object
Constructor Details
#initialize(components) ⇒ Definition
29 30 31 |
# File 'lib/pipely/definition.rb', line 29 def initialize(components) @components = components end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
33 34 35 |
# File 'lib/pipely/definition.rb', line 33 def components @components end |
Class Method Details
Instance Method Details
#apply_component_attributes(component_attributes) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/pipely/definition.rb', line 45 def apply_component_attributes(component_attributes) self.components.each do |component| if attributes = component_attributes[component.id] component.attributes = attributes end end end |
#components_for_graph ⇒ Object
35 36 37 38 39 |
# File 'lib/pipely/definition.rb', line 35 def components_for_graph components.reject { |component| NON_GRAPH_COMPONENT_TYPES.include?(component['type']) } end |
#to_json ⇒ Object
41 42 43 |
# File 'lib/pipely/definition.rb', line 41 def to_json { :objects => components }.to_json end |