Class: Pigpio::Buffer

Inherits:
String
  • Object
show all
Defined in:
lib/pigpio/buffer.rb,
ext/pigpio/pigpio.c

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ret_code, str = nil) ⇒ Buffer

Returns a new instance of Buffer.



4
5
6
7
# File 'lib/pigpio/buffer.rb', line 4

def initialize(ret_code, str = nil)
  super(str)
  @ret_code = ret_code
end

Instance Attribute Details

#ret_codeObject (readonly)

Returns the value of attribute ret_code.



3
4
5
# File 'lib/pigpio/buffer.rb', line 3

def ret_code
  @ret_code
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/pigpio/buffer.rb', line 9

def valid?
  @ret_code >= 0
end