Module: Vedeu::Presentation::Position Private
- Included in:
- Borders::Border, Cells::Empty, Interfaces::Interface, Interfaces::Null, Output::Write, Views::Composition, Views::Line, Views::Stream, Views::View
- Defined in:
- lib/vedeu/presentation/position.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Provide position functionality to the including model.
Instance Method Summary collapse
-
#position ⇒ NilClass|Vedeu::Geometries::Position
private
Gets the position.
-
#position=(value) ⇒ NilClass|Vedeu::Geometries::Position
private
Sets the position.
-
#position? ⇒ Boolean
private
Returns a boolean indicating the position attribute of the including model is set.
- #render_position(&block) ⇒ String private private
-
#x ⇒ Fixnum|NilClass
private
Returns the x coordinate for the model when the position attribute of the including model is set.
-
#y ⇒ Fixnum|NilClass
private
Returns the y coordinate for the model when the position attribute of the including model is set.
Instance Method Details
#position ⇒ NilClass|Vedeu::Geometries::Position
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Gets the position.
16 17 18 |
# File 'lib/vedeu/presentation/position.rb', line 16 def position Vedeu::Geometries::Position.coerce(@position) end |
#position=(value) ⇒ NilClass|Vedeu::Geometries::Position
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sets the position.
25 26 27 |
# File 'lib/vedeu/presentation/position.rb', line 25 def position=(value) @position = Vedeu::Geometries::Position.coerce(value) end |
#position? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a boolean indicating the position attribute of the including model is set.
33 34 35 |
# File 'lib/vedeu/presentation/position.rb', line 33 def position? position.is_a?(Vedeu::Geometries::Position) end |
#render_position(&block) ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
57 58 59 60 61 |
# File 'lib/vedeu/presentation/position.rb', line 57 def render_position(&block) return position.to_s { yield } if position? yield end |
#x ⇒ Fixnum|NilClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the x coordinate for the model when the position attribute of the including model is set.
41 42 43 |
# File 'lib/vedeu/presentation/position.rb', line 41 def x position.x if position? end |
#y ⇒ Fixnum|NilClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the y coordinate for the model when the position attribute of the including model is set.
49 50 51 |
# File 'lib/vedeu/presentation/position.rb', line 49 def y position.y if position? end |