Class: Mws::Apis::Feeds::SubmissionInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/mws/apis/feeds/submission_info.rb

Constant Summary collapse

Status =
Mws::Enum.for(
  done: '_DONE_', 
  submitted: '_SUBMITTED_', 
  in_progress: '_IN_PROGRESS_', 
  cancelled: '_CANCELLED_'
)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ SubmissionInfo

Returns a new instance of SubmissionInfo.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mws/apis/feeds/submission_info.rb', line 20

def initialize(node)
  @id = node.xpath('FeedSubmissionId').first.text.to_s
  @type = Feed::Type.for(node.xpath('FeedType').first.text)
  @status = Status.for(node.xpath('FeedProcessingStatus').first.text)
  @submitted = Time.parse(node.xpath('SubmittedDate').first.text.to_s)
  node.xpath('StartedProcessingDate').each do | node |
    @started = Time.parse(node.text.to_s)  
  end
  node.xpath('CompletedProcessingDate').each do | node |
    @completed = Time.parse(node.text.to_s)
  end
end

Instance Attribute Details

#completedObject

Returns the value of attribute completed.



16
17
18
# File 'lib/mws/apis/feeds/submission_info.rb', line 16

def completed
  @completed
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/mws/apis/feeds/submission_info.rb', line 16

def id
  @id
end

#startedObject

Returns the value of attribute started.



16
17
18
# File 'lib/mws/apis/feeds/submission_info.rb', line 16

def started
  @started
end

#submittedObject

Returns the value of attribute submitted.



16
17
18
# File 'lib/mws/apis/feeds/submission_info.rb', line 16

def 
  @submitted
end

Class Method Details

.from_xml(node) ⇒ Object



33
34
35
# File 'lib/mws/apis/feeds/submission_info.rb', line 33

def self.from_xml(node)
  new node
end

Instance Method Details

#==(other) ⇒ Object



37
38
39
40
41
# File 'lib/mws/apis/feeds/submission_info.rb', line 37

def ==(other)
  return true if equal? other
  return false unless other.class == self.class
  id == other.id
end