Class: ThriftClient::Simple::Field

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

Overview


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, fid) ⇒ Field

Returns a new instance of Field.



181
182
183
184
185
# File 'lib/thrift_client/simple.rb', line 181

def initialize(name, type, fid)
  @name = name
  @type = type
  @fid = fid
end

Instance Attribute Details

#fidObject

Returns the value of attribute fid.



179
180
181
# File 'lib/thrift_client/simple.rb', line 179

def fid
  @fid
end

#nameObject

Returns the value of attribute name.



179
180
181
# File 'lib/thrift_client/simple.rb', line 179

def name
  @name
end

#typeObject

Returns the value of attribute type.



179
180
181
# File 'lib/thrift_client/simple.rb', line 179

def type
  @type
end

Instance Method Details

#pack(value) ⇒ Object



187
188
189
# File 'lib/thrift_client/simple.rb', line 187

def pack(value)
  value.nil? ? "" : [ type.to_i, fid, ThriftClient::Simple.pack_value(type, value) ].pack("cna*")
end