Class: Cheezmiz::SubmitRequest

Inherits:
Message
  • Object
show all
Defined in:
lib/protocol/submit.rb

Instance Method Summary collapse

Methods inherited from Message

#data_fields, #initialize, #operation, parse, #prototype, #sequence_number

Constructor Details

This class inherits a constructor from Cheezmiz::Message

Instance Method Details

#check_params(params) ⇒ Object



44
45
46
47
48
# File 'lib/protocol/submit.rb', line 44

def check_params(params)
  if params.has_key?(:msisdn) && params.has_key?(:buddy_number)
    raise 'msisdn and buddy_number cannot be both present'
  end
end

#default_params(params) ⇒ Object



39
40
41
42
# File 'lib/protocol/submit.rb', line 39

def default_params(params)
  params[:type] ||= 1 # pc or mobile?
  params
end

#operation_codeObject



35
36
37
# File 'lib/protocol/submit.rb', line 35

def operation_code
  '14'
end

#params_lutObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/protocol/submit.rb', line 24

def params_lut
  {
    :message => '032',
    :buddy_number => '021', # buddy list number
    :origin => '023', # optional
    :time_stamp => '022', # optional
    :type => '030',
    :msisdn => '001'
  }
end