Sha256: 65b8e6e41ba9d41c34236d66398944b1ee0e97b1d1283a92ca48fd68e2dd7469

Contents?: true

Size: 961 Bytes

Versions: 7

Compression:

Stored size: 961 Bytes

Contents

module Elasticity

  class JobFlowStep

    attr_accessor :name
    attr_accessor :state

    class << self

      # Create a job flow from an AWS <member> (Nokogiri::XML::Element):
      #   /DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member/Steps/member
      def from_member_element(xml_element)
        job_flow_step = JobFlowStep.new
        job_flow_step.name = xml_element.xpath("./StepConfig/Name").text
        job_flow_step.state = xml_element.xpath("./ExecutionStatusDetail/State").text
        job_flow_step
      end

      # Create JobFlowSteps from a collection of AWS <member> nodes (Nokogiri::XML::NodeSet):
      #   /DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member/Steps/member
      def from_members_nodeset(members_nodeset)
        jobflow_steps = []
        members_nodeset.each do |member|
          jobflow_steps << from_member_element(member)
        end
        jobflow_steps
      end
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
elasticity-1.2.2 lib/elasticity/job_flow_step.rb
elasticity-1.2.1 lib/elasticity/job_flow_step.rb
elasticity-1.2 lib/elasticity/job_flow_step.rb
elasticity-1.1.1 lib/elasticity/job_flow_step.rb
elasticity-1.1 lib/elasticity/job_flow_step.rb
elasticity-1.0.1 lib/elasticity/job_flow_step.rb
elasticity-1.0 lib/elasticity/job_flow_step.rb