Class: Stylish::Position

Inherits:
Object
  • Object
show all
Defined in:
lib/stylish/numeric.rb

Constant Summary collapse

HORIZONTAL =
["left", "center", "right"]
VERTICAL =
["top", "center", "bottom"]

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#xObject

Returns the value of attribute x.



62
63
64
# File 'lib/stylish/numeric.rb', line 62

def x
  @x
end

#yObject

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