class Argus::NavOption
Attributes
tag[R]
Public Class Methods
initial_format()
click to toggle source
Skip the tag and size fields, We’ve already handled them in the base class.
# File lib/argus/nav_option.rb 30 def self.initial_format 31 "x4" 32 end
new(data)
click to toggle source
# File lib/argus/nav_option.rb 6 def initialize(data) 7 @tag, @size = data.unpack("vv") 8 end
options()
click to toggle source
# File lib/argus/nav_option.rb 14 def self.options 15 @options ||= { } 16 end
parse(raw_data)
click to toggle source
# File lib/argus/nav_option.rb 22 def self.parse(raw_data) 23 tag = raw_data.unpack("v").first 24 option = options[tag] || NavOptionUnknown 25 option.new(raw_data) 26 end
register(option)
click to toggle source
# File lib/argus/nav_option.rb 18 def self.register(option) 19 options[option.tag] = option 20 end
Public Instance Methods
size()
click to toggle source
# File lib/argus/nav_option.rb 10 def size 11 @size < 4 ? 4 : @size 12 end