Class: Elasticity::JobFlowStatusStep

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#ended_atObject

Returns the value of attribute ended_at.



9
10
11
# File 'lib/elasticity/job_flow_status_step.rb', line 9

def ended_at
  @ended_at
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#started_atObject

Returns the value of attribute started_at.



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

def started_at
  @started_at
end

#stateObject

Returns the value of attribute state.



6
7
8
# File 'lib/elasticity/job_flow_status_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


13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/elasticity/job_flow_status_step.rb', line 13

def self.from_member_element(xml_element)
  job_flow_step = JobFlowStatusStep.new
  job_flow_step.name = xml_element.xpath('./StepConfig/Name').text.strip
  job_flow_step.state = xml_element.xpath('./ExecutionStatusDetail/State').text.strip
  created_at = xml_element.xpath('./ExecutionStatusDetail/CreationDateTime').text.strip
  job_flow_step.created_at = (created_at == '') ? (nil) : (Time.parse(created_at))
  started_at = xml_element.xpath('./ExecutionStatusDetail/StartDateTime').text.strip
  job_flow_step.started_at = (started_at == '') ? (nil) : (Time.parse(started_at))
  ended_at = xml_element.xpath('./ExecutionStatusDetail/EndDateTime').text.strip
  job_flow_step.ended_at = (ended_at == '') ? (nil) : (Time.parse(ended_at))
  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


28
29
30
31
32
33
34
# File 'lib/elasticity/job_flow_status_step.rb', line 28

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