Class: ThriftClient::Simple::Field
- Inherits:
-
Object
- Object
- ThriftClient::Simple::Field
- Defined in:
- lib/thrift_client/simple.rb
Overview
Instance Attribute Summary collapse
-
#fid ⇒ Object
Returns the value of attribute fid.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, fid) ⇒ Field
constructor
A new instance of Field.
- #pack(value) ⇒ Object
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
#fid ⇒ Object
Returns the value of attribute fid.
179 180 181 |
# File 'lib/thrift_client/simple.rb', line 179 def fid @fid end |
#name ⇒ Object
Returns the value of attribute name.
179 180 181 |
# File 'lib/thrift_client/simple.rb', line 179 def name @name end |
#type ⇒ Object
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 |