In Files

Parent

Files

CTAPI::APDU

APDU (Application Protocol Data Unit) that is sent to/received from the cardterminal. This is the parent class of Command and Response.

Attributes

data[R]

This is the data string.

Public Class Methods

new(data) click to toggle source

An APDU object is generated from the String data.

# File lib/ctapi.rb, line 398
    def initialize(data)
      @data = data
    end

Public Instance Methods

[](*args) click to toggle source

Access data string by indices.

# File lib/ctapi.rb, line 406
    def [](*args) @data[*args] end
inspect() click to toggle source

We use Ruby’s inspect representation to inspect the data.

# File lib/ctapi.rb, line 409
    def inspect
      @data.inspect
    end
to_s() click to toggle source

To display the data, a string of the form ‘12:23:a4’ is built.

# File lib/ctapi.rb, line 414
    def to_s
      @data.unpack('C*').map { |x| sprintf("%02x", x) }.join(':')
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.