Class: Hakuban::ObjectDescriptor
- Inherits:
-
Object
- Object
- Hakuban::ObjectDescriptor
- Defined in:
- lib/hakuban/hakuban.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(tags, json) ⇒ ObjectDescriptor
constructor
A new instance of ObjectDescriptor.
- #inspect ⇒ Object
- #to_ffi ⇒ Object
Constructor Details
#initialize(tags, json) ⇒ ObjectDescriptor
Returns a new instance of ObjectDescriptor.
109 110 111 |
# File 'lib/hakuban/hakuban.rb', line 109 def initialize(,json) @tags, @json = Set.new(), json end |
Instance Attribute Details
#json ⇒ Object (readonly)
Returns the value of attribute json.
107 108 109 |
# File 'lib/hakuban/hakuban.rb', line 107 def json @json end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
107 108 109 |
# File 'lib/hakuban/hakuban.rb', line 107 def @tags end |
Class Method Details
.from_ffi(ffi) ⇒ Object
117 118 119 |
# File 'lib/hakuban/hakuban.rb', line 117 def self.from_ffi(ffi) ObjectDescriptor.new(ffi., ffi.json) end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
121 122 123 |
# File 'lib/hakuban/hakuban.rb', line 121 def ==(other) @tags == other. and @json == other.json end |
#hash ⇒ Object
127 128 129 |
# File 'lib/hakuban/hakuban.rb', line 127 def hash [@tags.hash, @json.hash].hash end |
#inspect ⇒ Object
131 132 133 |
# File 'lib/hakuban/hakuban.rb', line 131 def inspect "#<ObjectDescriptor @tags={%s}, @json=%p>"%[self..map(&:inspect).join(","), self.json] end |
#to_ffi ⇒ Object
113 114 115 |
# File 'lib/hakuban/hakuban.rb', line 113 def to_ffi FFI::FFIObjectDescriptor.construct(@tags, @json) end |