Class: LibStorj::Ext::Storj::Bucket
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LibStorj::Ext::Storj::Bucket
- Extended by:
- FFI::Library
- Defined in:
- lib/ruby-libstorj/ext/types.rb,
lib/ruby-libstorj/ext/bucket.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- .all(*args) ⇒ Object
- .create(*args) ⇒ Object
- .delete(*args) ⇒ Object
- .pointer_to_array(pointer, array_length) ⇒ Object
Instance Method Summary collapse
-
#initialize(*args) ⇒ Bucket
constructor
A new instance of Bucket.
Constructor Details
#initialize(*args) ⇒ Bucket
Returns a new instance of Bucket.
10 11 12 13 14 15 |
# File 'lib/ruby-libstorj/ext/bucket.rb', line 10 def initialize(*args) super(*args) @name = self[:name] @id = self[:id] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/ruby-libstorj/ext/bucket.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/ruby-libstorj/ext/bucket.rb', line 8 def name @name end |
Class Method Details
.all(*args) ⇒ Object
17 18 19 |
# File 'lib/ruby-libstorj/ext/bucket.rb', line 17 def self.all(*args) _all(*args) end |
.create(*args) ⇒ Object
21 22 23 |
# File 'lib/ruby-libstorj/ext/bucket.rb', line 21 def self.create(*args) _create(*args) end |
.delete(*args) ⇒ Object
25 26 27 |
# File 'lib/ruby-libstorj/ext/bucket.rb', line 25 def self.delete(*args) _delete(*args) end |
.pointer_to_array(pointer, array_length) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ruby-libstorj/ext/bucket.rb', line 29 def self.pointer_to_array(pointer, array_length) if pointer.nil? || pointer == FFI::MemoryPointer::NULL || array_length < 1 return nil end ### #=> [#<LibStorj::Ext::Storj::Bucket ...>, ...] (0..(array_length - 1)).map do |i| Bucket.new pointer[i * size] end end |