Class: Numeric
Overview
Numeric
Instance Method Summary collapse
-
#clamp(min, max) ⇒ Numeric
Clamps itself between two values.
-
#em ⇒ String
Returns the em representation.
-
#px ⇒ String
Returns the px representation.
Instance Method Details
#clamp(min, max) ⇒ Numeric
Clamps itself between two values
9 10 11 |
# File 'opal/fron/core_ext/numeric.rb', line 9 def clamp(min, max) [[self, max].min, min].max end |
#em ⇒ String
Returns the em representation
23 24 25 |
# File 'opal/fron/core_ext/numeric.rb', line 23 def em "#{self}em" end |
#px ⇒ String
Returns the px representation
16 17 18 |
# File 'opal/fron/core_ext/numeric.rb', line 16 def px "#{round}px" end |