Class: Ucp::Pdu::Ucp60Operation

Inherits:
UCP60 show all
Defined in:
lib/ucp/pdu/ucp60_operation.rb

Constant Summary

Constants inherited from UCPMessage

Ucp::Pdu::UCPMessage::DELIMITER, Ucp::Pdu::UCPMessage::ETX, Ucp::Pdu::UCPMessage::STX

Instance Attribute Summary

Attributes inherited from UCPMessage

#dcs, #message_ref, #operation, #operation_type, #part_nr, #total_parts, #trn

Instance Method Summary collapse

Methods inherited from UCPMessage

#checksum, #get_field, #is_ack?, #is_nack?, #is_operation?, #is_result?, #length, #set_field, #set_fields, #to_s

Constructor Details

#initialize(fields = nil) ⇒ Ucp60Operation

Returns a new instance of Ucp60Operation.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ucp/pdu/ucp60_operation.rb', line 23

def initialize(fields=nil)
  super()
  #@operation="60"
  @operation_type="O"
  @fields=[:oadc,:oton,:onpi,:styp,:pwd,:npwd,:vers,:ladc,:lton,:lnpi,:opid,:res1]

  if fields.nil?
    return
  end


  @trn=fields[0]
  @operation_type=fields[2]
  @operation=fields[3]

   # *00/00050/O/60/8006/6/5/1/F474FB2D07//0100//////15#

   for i in 4..(fields.length-1)
     field=@fields[i-4]
     @h[field]=fields[i]
   end

end

Instance Method Details

#basic_auth(originator, password, ucpfields = {}) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/ucp/pdu/ucp60_operation.rb', line 50

def basic_auth(originator,password,ucpfields={})
  #super()
  #@operation_type="O"
  
  @h={:oadc=>originator, :pwd=>UCP.ascii2ira(password).encoded, :vers=>"0100", :styp=>"1", :oton=>"6",:onpi=>"5"}
  @h=@h.merge ucpfields
end