Class: Drone::Storage::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/drone/storage/base.rb

Direct Known Subclasses

Memory

Instance Method Summary collapse

Instance Method Details

#request_fixed_size_array(id, size, initial_value = nil) ⇒ Object

Request a fixed size array.

Parameters:

  • id (String)

    Any string which makes sense in the context

  • size (Number)

    The Array size

  • initial_value (Number) (defaults to: nil)

    The default value for the cells

Returns:

  • (Object)

    Returns an object which share the same external interface as the Array class



90
91
92
# File 'lib/drone/storage/base.rb', line 90

def request_fixed_size_array(id, size, initial_value = nil)
  raise "needs to be redefined"
end

#request_hash(id) ⇒ Object

Request a hash.

Parameters:

  • id (String)

    Any string which makes sense in the context

Returns:

  • (Object)

    Returns an object which share the same external interface as the Hash class



102
103
104
# File 'lib/drone/storage/base.rb', line 102

def request_hash(id)
  raise "needs to be redefined"
end

#request_number(id, initial_value = 0) ⇒ SharedNumber

Request a number “slot”.

Parameters:

  • id (String)

    Any string which makes sense in the context

  • initial_value (Number) (defaults to: 0)

    The intial value

Returns:

  • (SharedNumber)

    An intance of a class inheriting SharedNumber

See Also:



116
117
118
# File 'lib/drone/storage/base.rb', line 116

def request_number(id, initial_value = 0)
  raise "needs to be redefined"
end