Class: Arcp::Job::Subscribe

Inherits:
Data
  • Object
show all
Defined in:
lib/arcp/job/subscribe.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#from_event_seqObject (readonly)

Returns the value of attribute from_event_seq

Returns:

  • (Object)

    the current value of from_event_seq



5
6
7
# File 'lib/arcp/job/subscribe.rb', line 5

def from_event_seq
  @from_event_seq
end

#historyObject (readonly)

Returns the value of attribute history

Returns:

  • (Object)

    the current value of history



5
6
7
# File 'lib/arcp/job/subscribe.rb', line 5

def history
  @history
end

#job_idObject (readonly)

Returns the value of attribute job_id

Returns:

  • (Object)

    the current value of job_id



5
6
7
# File 'lib/arcp/job/subscribe.rb', line 5

def job_id
  @job_id
end

Class Method Details

.from_h(h) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/arcp/job/subscribe.rb', line 6

def self.from_h(h)
  h = h.transform_keys(&:to_s)
  new(
    job_id: h.fetch('job_id'),
    from_event_seq: h['from_event_seq'],
    history: h.fetch('history', false)
  )
end

Instance Method Details

#to_hObject



15
16
17
18
19
# File 'lib/arcp/job/subscribe.rb', line 15

def to_h
  out = { 'job_id' => job_id, 'history' => history }
  out['from_event_seq'] = from_event_seq if from_event_seq
  out
end