Class: CzechPost::CodeGenerator::SerialNumber

Inherits:
Object
  • Object
show all
Defined in:
lib/czech_post/code_generator/serial_number.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_id, order_id, client_id = nil, client_type = nil) ⇒ SerialNumber

Returns a new instance of SerialNumber.



6
7
8
9
10
11
# File 'lib/czech_post/code_generator/serial_number.rb', line 6

def initialize(service_id, order_id, client_id = nil, client_type = nil)
  @service_id = service_id
  @order_id = order_id
  @client_id = client_id
  @client_type = client_type
end

Instance Attribute Details

#order_idObject (readonly)

Returns the value of attribute order_id.



4
5
6
# File 'lib/czech_post/code_generator/serial_number.rb', line 4

def order_id
  @order_id
end

#service_idObject (readonly)

Returns the value of attribute service_id.



4
5
6
# File 'lib/czech_post/code_generator/serial_number.rb', line 4

def service_id
  @service_id
end

Instance Method Details

#runObject



13
14
15
# File 'lib/czech_post/code_generator/serial_number.rb', line 13

def run
  "#{service_id}#{client_id}#{order_number.id}#{check_number}#{client_type}"
end