Module: JvmBytecode::AccessFlag

Included in:
ClassFile, Field, Method
Defined in:
lib/jvm_bytecode/access_flag.rb

Instance Method Summary collapse

Instance Method Details

#access_flag(*flags) ⇒ Object



7
8
9
10
# File 'lib/jvm_bytecode/access_flag.rb', line 7

def access_flag(*flags)
  @acc_flag = flags.map(&all_access_flag.method(:[])).reduce(0, &:|) if flags.any?
  @acc_flag || 0
end

#all_access_flagObject



3
4
5
# File 'lib/jvm_bytecode/access_flag.rb', line 3

def all_access_flag
  self.class::ACCESS_FLAGS
end

#readable_access_flagObject



16
17
18
# File 'lib/jvm_bytecode/access_flag.rb', line 16

def readable_access_flag
  all_access_flag.select { |k, v| (@acc_flag & v) > 0 }.keys
end

#set_access_flag(acc_flag) ⇒ Object



12
13
14
# File 'lib/jvm_bytecode/access_flag.rb', line 12

def set_access_flag(acc_flag)
  @acc_flag = acc_flag
end