Class: Stylish::Position
- Inherits:
-
Object
- Object
- Stylish::Position
- Defined in:
- lib/stylish/numeric.rb
Constant Summary collapse
- HORIZONTAL =
["left", "center", "right"]
- VERTICAL =
["top", "center", "bottom"]
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(xpos, ypos) ⇒ Position
constructor
A new instance of Position.
- #to_s(symbols = {}, scope = "") ⇒ Object
Constructor Details
#initialize(xpos, ypos) ⇒ Position
Returns a new instance of Position.
64 65 66 67 |
# File 'lib/stylish/numeric.rb', line 64 def initialize(xpos, ypos) self.x = xpos || "center" self.y = ypos || "center" end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
62 63 64 |
# File 'lib/stylish/numeric.rb', line 62 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
62 63 64 |
# File 'lib/stylish/numeric.rb', line 62 def y @y end |
Instance Method Details
#to_s(symbols = {}, scope = "") ⇒ Object
89 90 91 |
# File 'lib/stylish/numeric.rb', line 89 def to_s(symbols = {}, scope = "") @x.to_s + " " + @y.to_s end |