Class: Mingle::Io::Decoder
Constant Summary
BitGirder::Core::BitGirderMethods::PARAM_TYPE_ARG, BitGirder::Core::BitGirderMethods::PARAM_TYPE_ENVVAR, BitGirder::Core::BitGirderMethods::PARAM_TYPE_KEY
Instance Method Summary
collapse
argv_to_argh, check_fail_prefix, class_name_to_sym, code, compares_to, console, ext_to_class_name, ext_to_sym, has_env, has_key, has_keys, nonnegative, not_nil, positive, raisef, set_from_key, set_var, split_argv, sym_to_cli_switch, sym_to_ext_id, to_bool, unpack_argv_array, unpack_argv_hash, warn
#==, included
Instance Method Details
#expect_type_code(expct) ⇒ Object
121
122
123
124
125
126
127
128
129
|
# File 'lib/mingle/io.rb', line 121
def expect_type_code( expct )
unless ( act = read_type_code ) == expct
tmpl = "Invalid type :code => 0x%08x (expected 0x%08x)"
msg = sprintf( tmpl, act, expct )
raise InvalidTypeCodeError.new( msg )
end
end
|
#expect_version(expct, ver_typ) ⇒ Object
105
106
107
108
109
110
111
112
113
|
# File 'lib/mingle/io.rb', line 105
def expect_version( expct, ver_typ )
unless ( ver = read_version ) == expct
tmpl = "Invalid %s :version => 0x%08x (expected 0x%08x)"
msg = sprintf( tmpl, ver_typ, ver, expct )
raise InvalidVersionError.new( msg )
end
end
|
#read_type_code ⇒ Object
116
117
118
|
# File 'lib/mingle/io.rb', line 116
def read_type_code
read_int32
end
|
#read_version ⇒ Object
100
101
102
|
# File 'lib/mingle/io.rb', line 100
def read_version
read_int32
end
|