Class: MIFARE::DESFire::FILE_PERMISSION

Inherits:
Struct
  • Object
show all
Defined in:
lib/mifare/des_fire.rb

Overview

value 0x00 ~ 0x0D are key numbers, 0x0E grants free access, 0x0F always denies access

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#change_accessObject

Returns the value of attribute change_access

Returns:

  • (Object)

    the current value of change_access


126
127
128
# File 'lib/mifare/des_fire.rb', line 126

def change_access
  @change_access
end

#read_accessObject

Returns the value of attribute read_access

Returns:

  • (Object)

    the current value of read_access


126
127
128
# File 'lib/mifare/des_fire.rb', line 126

def read_access
  @read_access
end

#read_write_accessObject

Returns the value of attribute read_write_access

Returns:

  • (Object)

    the current value of read_write_access


126
127
128
# File 'lib/mifare/des_fire.rb', line 126

def read_write_access
  @read_write_access
end

#write_accessObject

Returns the value of attribute write_access

Returns:

  • (Object)

    the current value of write_access


126
127
128
# File 'lib/mifare/des_fire.rb', line 126

def write_access
  @write_access
end

Class Method Details

.import(byte) ⇒ Object


127
128
129
130
131
132
133
134
# File 'lib/mifare/des_fire.rb', line 127

def self.import(byte)
  self.new(
    (byte >> 12) & 0x0F,
    (byte >> 8) & 0x0F,
    (byte >> 4) & 0x0F,
    byte & 0x0F
  )
end

Instance Method Details

#exportObject


136
137
138
# File 'lib/mifare/des_fire.rb', line 136

def export
  (read_access << 12) | (write_access << 8) | (read_write_access << 4) | change_access
end