Class: Stylish::Length
- Inherits:
-
Object
- Object
- Stylish::Length
- Defined in:
- lib/stylish/numeric.rb
Constant Summary collapse
- UNITS =
[ # Relative length units "em", "ex", "px", # Absolute length units "in", "cm", "mm", "pt", "pc"]
Instance Attribute Summary collapse
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Length
constructor
A new instance of Length.
- #to_s(symbols = {}, scope = "") ⇒ Object
Constructor Details
Instance Attribute Details
#unit ⇒ Object
Returns the value of attribute unit.
32 33 34 |
# File 'lib/stylish/numeric.rb', line 32 def unit @unit end |
#value ⇒ Object
Returns the value of attribute value.
32 33 34 |
# File 'lib/stylish/numeric.rb', line 32 def value @value end |
Instance Method Details
#to_s(symbols = {}, scope = "") ⇒ Object
53 54 55 |
# File 'lib/stylish/numeric.rb', line 53 def to_s(symbols = {}, scope = "") self.value.to_s + self.unit end |