Class: Moxml::NativeAttachment
- Inherits:
-
Object
- Object
- Moxml::NativeAttachment
- Defined in:
- lib/moxml/native_attachment.rb,
lib/moxml/native_attachment/opal.rb,
lib/moxml/native_attachment/native.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
Class Method Summary collapse
Instance Method Summary collapse
- #delete(native, key) ⇒ Object
- #get(native, key) ⇒ Object
-
#initialize(backend: self.class.default_backend) ⇒ NativeAttachment
constructor
A new instance of NativeAttachment.
- #key?(native, key) ⇒ Boolean
- #set(native, key, value) ⇒ Object
Constructor Details
#initialize(backend: self.class.default_backend) ⇒ NativeAttachment
Returns a new instance of NativeAttachment.
15 16 17 |
# File 'lib/moxml/native_attachment.rb', line 15 def initialize(backend: self.class.default_backend) @backend = backend end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
13 14 15 |
# File 'lib/moxml/native_attachment.rb', line 13 def backend @backend end |
Class Method Details
.default_backend ⇒ Object
8 9 10 11 |
# File 'lib/moxml/native_attachment.rb', line 8 def self.default_backend constant = RUBY_ENGINE == "opal" ? :Opal : :Native const_get(constant).new end |
Instance Method Details
#delete(native, key) ⇒ Object
31 32 33 |
# File 'lib/moxml/native_attachment.rb', line 31 def delete(native, key) @backend.delete(native, key) end |
#get(native, key) ⇒ Object
19 20 21 |
# File 'lib/moxml/native_attachment.rb', line 19 def get(native, key) @backend.get(native, key) end |
#key?(native, key) ⇒ Boolean
27 28 29 |
# File 'lib/moxml/native_attachment.rb', line 27 def key?(native, key) @backend.key?(native, key) end |
#set(native, key, value) ⇒ Object
23 24 25 |
# File 'lib/moxml/native_attachment.rb', line 23 def set(native, key, value) @backend.set(native, key, value) end |