Sha256: 5808904aa6936b788af6a2b63eec614a35f376777f9828a6f97a63e29980da25

Contents?: true

Size: 531 Bytes

Versions: 17

Compression:

Stored size: 531 Bytes

Contents

#
# This module provides a set of Sass functions for working with Sass::Number
#
module Archetype::SassExtensions::Numbers
  #
  # remove the units from a number
  #
  # *Parameters*:
  # - <tt>$number</tt> {Number} the number to remove units from
  # *Returns*:
  # - {Number} the number without units
  #
  def strip_units(number)
    value = 0
    value = number.value.to_f if number.is_a?(Sass::Script::String)
    value = number.value if number.is_a?(Sass::Script::Number)
    return Sass::Script::Number.new(value)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
archetype-0.0.1.pre.13 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.12 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.11 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.10 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.9 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.8 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.7 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.6 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.5 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.4 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.3.90263a7 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.3.6ed259b lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.3.f9dde24 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.3.00dfd9a lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.3.83f0d7a lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.3.55c4182 lib/archetype/sass_extensions/functions/numbers.rb
archetype-0.0.1.pre.3.811928f lib/archetype/sass_extensions/functions/numbers.rb