Class: Parts::StringParam
- Inherits:
-
Object
- Object
- Parts::StringParam
- Defined in:
- lib/parts.rb
Instance Method Summary collapse
-
#initialize(str) ⇒ StringParam
constructor
A new instance of StringParam.
- #read(offset, how_much) ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(str) ⇒ StringParam
Returns a new instance of StringParam.
17 18 19 |
# File 'lib/parts.rb', line 17 def initialize (str) @str = str end |
Instance Method Details
#read(offset, how_much) ⇒ Object
25 26 27 |
# File 'lib/parts.rb', line 25 def read (offset, how_much) @str[offset, how_much] end |
#size ⇒ Object
21 22 23 |
# File 'lib/parts.rb', line 21 def size @str.length end |