Class: Elasticity::JobFlowStep

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticity/job_flow_step.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#ended_atObject

Returns the value of attribute ended_at.



8
9
10
# File 'lib/elasticity/job_flow_step.rb', line 8

def ended_at
  @ended_at
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/elasticity/job_flow_step.rb', line 5

def name
  @name
end

#started_atObject

Returns the value of attribute started_at.



7
8
9
# File 'lib/elasticity/job_flow_step.rb', line 7

def started_at
  @started_at
end

#stateObject

Returns the value of attribute state.



6
7
8
# File 'lib/elasticity/job_flow_step.rb', line 6

def state
  @state
end

Class Method Details

.from_member_element(xml_element) ⇒ Object

Create a job flow from an AWS <member> (Nokogiri::XML::Element):

/DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member/Steps/member


14
15
16
17
18
19
20
21
# File 'lib/elasticity/job_flow_step.rb', line 14

def from_member_element(xml_element)
  job_flow_step = JobFlowStep.new
  job_flow_step.name = xml_element.xpath("./StepConfig/Name").text.strip
  job_flow_step.state = xml_element.xpath("./ExecutionStatusDetail/State").text.strip
  job_flow_step.started_at = xml_element.xpath("./ExecutionStatusDetail/StartDateTime").text.strip
  job_flow_step.ended_at = xml_element.xpath("./ExecutionStatusDetail/EndDateTime").text.strip
  job_flow_step
end

.from_members_nodeset(members_nodeset) ⇒ Object

Create JobFlowSteps from a collection of AWS <member> nodes (Nokogiri::XML::NodeSet):

/DescribeJobFlowsResponse/DescribeJobFlowsResult/JobFlows/member/Steps/member


25
26
27
28
29
30
31
# File 'lib/elasticity/job_flow_step.rb', line 25

def from_members_nodeset(members_nodeset)
  jobflow_steps = []
  members_nodeset.each do |member|
    jobflow_steps << from_member_element(member)
  end
  jobflow_steps
end