class NodeAdapter

NodeAdapter. @class_description

A NodeAdapter implementation. Implements the NodeAdapter interface.

@attr back [NodeAdapter, NilClass]

A backward reference.

@attr data [DataType]

A data instance reference.

@attr front [NodeAdapter, NilClass]

A forward reference.

NodeAdapter. @class_description

A NodeAdapter implementation. Implements the NodeAdapter interface.

@attr back [NodeAdapter, NilClass]

A backward reference.

@attr data [DataType]

A data instance reference.

@attr front [NodeAdapter, NilClass]

A forward reference.

Constants

VERSION

Public Class Methods

new(n = nil) click to toggle source

initialize(n = nil). @description

Initializes a NodeAdapter.

@param n [Node]

The adapting instance.

@return [NodeAdapter]

The instance.

@raise [ArgumentError]

In the case n is not a Node instance.
# File lib/node_adapter_impl.rb, line 26
def initialize(n = nil)

  unless (n.instance_of?(Node))
    raise(ArgumentError, "#{n} is not a Node instance.")
  else

    self.back  = n.back_ref()
    self.data  = n.data()
    self.front = n.front_ref()

  end

end

Public Instance Methods

attach_back(n = nil) click to toggle source

attach_back(n = nil). @description

Attaches 'back' a NodeAdapter.

@param n [NodeAdapter]

An attachment NodeAdapter.

@return [NilClass]

nil.

@raise [ArgumentError]

In the case the argument is any type other than NodeAdapter.
# File lib/node_adapter_impl.rb, line 67
def attach_back(n = nil)

  unless (n.instance_of?(NodeAdapter))
    raise(ArgumentError, "#{n} is not a NodeAdapter instance.")
  else
    self.back = n
    return nil
  end

end
attach_front(n = nil) click to toggle source

attach_front(n = nil). @description

Attaches 'front' the argument NodeAdapter.

@param n [NodeAdapter]

The attachment.

@return [NilClass]

nil.

@raise [ArgumentError]

In the case the argument is any type other than NodeAdapter.
# File lib/node_adapter_impl.rb, line 87
def attach_front(n = nil)

  unless (n.instance_of?(NodeAdapter))
    raise(ArgumentError, "#{n} is not a NodeAdapter instance.")
  else
    self.front = n
    return nil
  end

end
back() click to toggle source

back(). @description

Gets back's reference.

@return [NodeAdapter, NilClass]

back's reference.
# File lib/node_adapter_impl.rb, line 45
def back()
  return @back
end
detach_back() click to toggle source

detach_back(). @description

Sets 'back' nil.

@return [NilClass]

nil.
# File lib/node_adapter_impl.rb, line 103
def detach_back()
  self.back = nil
end
detach_front() click to toggle source

detach_front(). @description

Sets 'front' nil.

@return [NilClass]

nil.
# File lib/node_adapter_impl.rb, line 112
def detach_front()
  self.front = nil
end
front() click to toggle source

front(). @description

Gets front's reference.

@return [NodeAdapter, NilClass]

front's reference.
# File lib/node_adapter_impl.rb, line 54
def front()
  return @front
end

Private Instance Methods

back=(n = nil) click to toggle source

back=(n = nil). @description

Sets back's reference.

@param n [NodeAdapter, NilClass]

back's setting.

@return [NodeAdapter, NilClass]

The argument.
# File lib/node_adapter_impl.rb, line 125
def back=(n = nil)
  @back = n
end
front=(n = nil) click to toggle source

front=(n = nil). @description

Sets front's reference.

@param n [NodeAdapter, NilClass]

front's setting.

@return [NodeAdapter, NilClass]

The argument.
# File lib/node_adapter_impl.rb, line 136
def front=(n = nil)
  @front = n
end