Class: YARP::LibRubyParser::YPString
- Inherits:
-
Object
- Object
- YARP::LibRubyParser::YPString
- Defined in:
- lib/yarp/ffi.rb
Overview
This object represents a yp_string_t. We only use it as an opaque pointer, so it doesn’t have to be an FFI::Struct.
Instance Attribute Summary collapse
-
#pointer ⇒ Object
readonly
Returns the value of attribute pointer.
Instance Method Summary collapse
-
#initialize(pointer) ⇒ YPString
constructor
A new instance of YPString.
- #length ⇒ Object
- #read ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(pointer) ⇒ YPString
Returns a new instance of YPString.
121 122 123 |
# File 'lib/yarp/ffi.rb', line 121 def initialize(pointer) @pointer = pointer end |
Instance Attribute Details
#pointer ⇒ Object (readonly)
Returns the value of attribute pointer.
119 120 121 |
# File 'lib/yarp/ffi.rb', line 119 def pointer @pointer end |
Instance Method Details
#length ⇒ Object
129 130 131 |
# File 'lib/yarp/ffi.rb', line 129 def length LibRubyParser.yp_string_length(pointer) end |
#read ⇒ Object
133 134 135 |
# File 'lib/yarp/ffi.rb', line 133 def read source.read_string(length) end |
#source ⇒ Object
125 126 127 |
# File 'lib/yarp/ffi.rb', line 125 def source LibRubyParser.yp_string_source(pointer) end |