Class: BGS::People::Response

Inherits:
Object
  • Object
show all
Defined in:
app/services/bgs/people/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, status: :ok) ⇒ Response

Returns a new instance of Response.



8
9
10
11
# File 'app/services/bgs/people/response.rb', line 8

def initialize(response, status: :ok)
  @response = response
  @status = status
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'app/services/bgs/people/response.rb', line 6

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'app/services/bgs/people/response.rb', line 6

def status
  @status
end

Instance Method Details

#cache?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/services/bgs/people/response.rb', line 31

def cache?
  status == :ok
end

#file_numberObject



19
20
21
22
23
# File 'app/services/bgs/people/response.rb', line 19

def file_number
  return if response.blank?

  response[:file_nbr]
end

#participant_idObject



13
14
15
16
17
# File 'app/services/bgs/people/response.rb', line 13

def participant_id
  return if response.blank?

  response[:ptcpnt_id]
end

#ssn_numberObject



25
26
27
28
29
# File 'app/services/bgs/people/response.rb', line 25

def ssn_number
  return if response.blank?

  response[:ssn_nbr]
end