Class: Parts::StringParam

Inherits:
Object
  • Object
show all
Defined in:
lib/parts.rb

Instance Method Summary collapse

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

#sizeObject



21
22
23
# File 'lib/parts.rb', line 21

def size
  @str.length
end