Class: Moxml::NativeAttachment::Opal
- Inherits:
-
Object
- Object
- Moxml::NativeAttachment::Opal
- Defined in:
- lib/moxml/native_attachment/opal.rb
Overview
Opal adapter nodes are Ruby objects, so instance variables are sufficient for Moxml-owned attachments without relying on Monitor/Thread support.
Instance Method Summary collapse
- #delete(native, key) ⇒ Object
- #get(native, key) ⇒ Object
- #key?(native, key) ⇒ Boolean
- #set(native, key, value) ⇒ Object
Instance Method Details
#delete(native, key) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/moxml/native_attachment/opal.rb', line 20 def delete(native, key) ivar_name = (key) return unless native.instance_variable_defined?(ivar_name) native.remove_instance_variable(ivar_name) end |
#get(native, key) ⇒ Object
8 9 10 |
# File 'lib/moxml/native_attachment/opal.rb', line 8 def get(native, key) native.instance_variable_get((key)) end |
#key?(native, key) ⇒ Boolean
16 17 18 |
# File 'lib/moxml/native_attachment/opal.rb', line 16 def key?(native, key) native.instance_variable_defined?((key)) end |
#set(native, key, value) ⇒ Object
12 13 14 |
# File 'lib/moxml/native_attachment/opal.rb', line 12 def set(native, key, value) native.instance_variable_set((key), value) end |