Class: Ruby::SerialString
- Inherits:
-
Object
- Object
- Ruby::SerialString
- Includes:
- SerialData
- Defined in:
- lib/ruby/proto.rb
Instance Attribute Summary collapse
-
#read_index ⇒ Object
readonly
Returns the value of attribute read_index.
-
#str ⇒ Object
readonly
Returns the value of attribute str.
Instance Method Summary collapse
-
#initialize(_value = "") ⇒ SerialString
constructor
A new instance of SerialString.
- #resetString(_value = "") ⇒ Object
Methods included from SerialData
byteArrayToInt, intToByteArray, #loadInt16, #loadInt32, #loadInt8, #storeInt16, #storeInt32, #storeInt8
Constructor Details
#initialize(_value = "") ⇒ SerialString
Returns a new instance of SerialString.
134 135 136 |
# File 'lib/ruby/proto.rb', line 134 def initialize(_value = "") resetString(_value) end |
Instance Attribute Details
#read_index ⇒ Object (readonly)
Returns the value of attribute read_index.
132 133 134 |
# File 'lib/ruby/proto.rb', line 132 def read_index @read_index end |
#str ⇒ Object (readonly)
Returns the value of attribute str.
132 133 134 |
# File 'lib/ruby/proto.rb', line 132 def str @str end |
Instance Method Details
#resetString(_value = "") ⇒ Object
138 139 140 141 142 143 144 |
# File 'lib/ruby/proto.rb', line 138 def resetString(_value = "") @str = "" @str.encode!("binary") _value = _value || "" @str <<_value @read_index = 0 end |