Class: Hakuban::TagDescriptor

Inherits:
FFIObject show all
Defined in:
lib/hakuban/descriptor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#jsonObject (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

#hashObject



81
82
83
# File 'lib/hakuban/descriptor.rb', line 81

def hash
	@json.hash
end

#inspectObject



85
86
87
# File 'lib/hakuban/descriptor.rb', line 85

def inspect
	"#<TagDescriptor @json=%p>"%[self.json]
end