Class: Gqldb::Parameter

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: "", value: TypedValue.new) ⇒ Parameter

Returns a new instance of Parameter.



212
213
214
215
# File 'lib/tina4_ultipa/pb.rb', line 212

def initialize(name: "", value: TypedValue.new)
  @name = name.to_s
  @value = value
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



210
211
212
# File 'lib/tina4_ultipa/pb.rb', line 210

def name
  @name
end

#valueObject

Returns the value of attribute value.



210
211
212
# File 'lib/tina4_ultipa/pb.rb', line 210

def value
  @value
end

Class Method Details

.encode(msg) ⇒ Object



217
218
219
220
221
222
223
# File 'lib/tina4_ultipa/pb.rb', line 217

def self.encode(msg)
  buf = "".b
  Wire.write_string(buf, 1, msg.name)
  inner = TypedValue.encode(msg.value)
  Wire.write_bytes(buf, 2, inner)
  buf
end