Class: Hakuban::TagDescriptor
- Defined in:
- lib/hakuban/descriptor.rb
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
Returns the value of attribute json.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(json) ⇒ TagDescriptor
constructor
A new instance of TagDescriptor.
- #inspect ⇒ Object
Methods inherited from FFIObject
#do_and_drop, #do_and_drop_or_return, #drop, #drop_lock, #drop_release, #dropped?, generate_finalizer, #initialize_copy, #with_pointer, with_pointers
Constructor Details
#initialize(json) ⇒ TagDescriptor
Returns a new instance of TagDescriptor.
62 63 64 65 66 |
# File 'lib/hakuban/descriptor.rb', line 62 def initialize(json) Hakuban::hakuban_initialize @json = json.freeze initialize_pointer(FFI::hakuban_tag_descriptor_new(JSON.dump(json)).unwrap, :hakuban_tag_descriptor_drop, :hakuban_tag_descriptor_clone) end |
Instance Attribute Details
#json ⇒ Object (readonly)
Returns the value of attribute json.
60 61 62 |
# File 'lib/hakuban/descriptor.rb', line 60 def json @json end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
75 76 77 |
# File 'lib/hakuban/descriptor.rb', line 75 def ==(other) @json == other.json end |
#hash ⇒ Object
81 82 83 |
# File 'lib/hakuban/descriptor.rb', line 81 def hash @json.hash end |
#inspect ⇒ Object
85 86 87 |
# File 'lib/hakuban/descriptor.rb', line 85 def inspect "#<TagDescriptor @json=%p>"%[self.json] end |