Class: ThriftClient::Simple::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/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.



203
204
205
206
207
# File 'lib/vendor/thrift_client/simple.rb', line 203

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

Instance Attribute Details

#fidObject

Returns the value of attribute fid.



201
202
203
# File 'lib/vendor/thrift_client/simple.rb', line 201

def fid
  @fid
end

#nameObject

Returns the value of attribute name.



201
202
203
# File 'lib/vendor/thrift_client/simple.rb', line 201

def name
  @name
end

#typeObject

Returns the value of attribute type.



201
202
203
# File 'lib/vendor/thrift_client/simple.rb', line 201

def type
  @type
end

Instance Method Details

#pack(value) ⇒ Object



209
210
211
# File 'lib/vendor/thrift_client/simple.rb', line 209

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