Sha256: 240e19585ec0375e667950f64c9a2b4828dce1e8b38b24d525771bab40c15df3

Contents?: true

Size: 961 Bytes

Versions: 6

Compression:

Stored size: 961 Bytes

Contents

module Elasticity

  class JobFlow

    attr_accessor :name
    attr_accessor :jobflow_id
    attr_accessor :state

    class << self

      # Create a jobflow from an AWS <member> (Nokogiri::XML::Element):
      #  /DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member
      def from_member_element(xml_element)
        jobflow = JobFlow.new
        jobflow.name = xml_element.xpath("./Name").text
        jobflow.jobflow_id = xml_element.xpath("./JobFlowId").text
        jobflow.state = xml_element.xpath("./ExecutionStatusDetail/State").text
        jobflow
      end

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

    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
elasticity-0.6 lib/elasticity/job_flow.rb
elasticity-0.5 lib/elasticity/job_flow.rb
elasticity-0.4 lib/elasticity/job_flow.rb
elasticity-0.3.5 lib/elasticity/job_flow.rb
elasticity-0.3 lib/elasticity/job_flow.rb
elasticity-0.0.1 lib/elasticity/job_flow.rb