Class: BinaryParser::BuiltInTemplate::Flag
- Inherits:
-
TemplateBase
- Object
- TemplateBase
- BinaryParser::BuiltInTemplate::Flag
- Defined in:
- lib/binary_parser/built_in_template/flag.rb
Constant Summary
Constants included from BinaryParser::BuiltInTemplate
BCD, BCD_f1, BCD_f10, BCD_f2, BCD_f3, BCD_f4, BCD_f5, BCD_f6, BCD_f7, BCD_f8, BCD_f9
Instance Method Summary collapse
- #content_description ⇒ Object
- #off? ⇒ Boolean (also: #unflagged?)
- #on? ⇒ Boolean (also: #flagged?)
Methods inherited from TemplateBase
Def, #[], #binary_bit_length, #convert_into_abstract_binary, def_structure, def_var_method, #hold_enough_binary?, #hold_just_binary?, #initialize, #load, #names, #show, structure, #structure_bit_length, #to_chars, #to_i, #to_s
Methods included from BinaryParser::BuiltInTemplate
Constructor Details
This class inherits a constructor from BinaryParser::TemplateBase
Instance Method Details
#content_description ⇒ Object
17 18 19 |
# File 'lib/binary_parser/built_in_template/flag.rb', line 17 def content_description on? ? "true" : "false" end |
#off? ⇒ Boolean Also known as: unflagged?
11 12 13 |
# File 'lib/binary_parser/built_in_template/flag.rb', line 11 def off? return !on? end |
#on? ⇒ Boolean Also known as: flagged?
5 6 7 |
# File 'lib/binary_parser/built_in_template/flag.rb', line 5 def on? return to_i[0] == 1 end |