Class: InOrder::Aux::PositionBase

Inherits:
Object
  • Object
show all
Includes:
GetElement
Defined in:
app/models/in_order/aux/position_base.rb

Direct Known Subclasses

Insert, Move

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, marker, adjacency = nil) ⇒ PositionBase

Returns a new instance of PositionBase.



9
10
11
12
13
14
15
# File 'app/models/in_order/aux/position_base.rb', line 9

def initialize(target, marker, adjacency=nil)
  self.target = get_element target

  self.marker = get_element marker

  self.adjacency = adjacency.present? ? adjacency.to_sym : :after
end

Instance Attribute Details

#adjacencyObject

Returns the value of attribute adjacency.



7
8
9
# File 'app/models/in_order/aux/position_base.rb', line 7

def adjacency
  @adjacency
end

#markerObject

Returns the value of attribute marker.



7
8
9
# File 'app/models/in_order/aux/position_base.rb', line 7

def marker
  @marker
end

#targetObject

Returns the value of attribute target.



7
8
9
# File 'app/models/in_order/aux/position_base.rb', line 7

def target
  @target
end