File: function.rb

package info (click to toggle)
ruby-sass 3.7.4-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,396 kB
  • sloc: ruby: 32,443; sh: 26; makefile: 25
file content (19 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Sass::Script::Value
  # A SassScript object representing a function.
  class Function < Callable
    # Constructs a Function value for use in SassScript.
    #
    # @param function [Sass::Callable] The callable to be used when the
    # function is invoked.
    def initialize(function)
      unless function.type == "function"
        raise ArgumentError.new("A callable of type function was expected.")
      end
      super
    end

    def to_sass
      %{get-function("#{value.name}")}
    end
  end
end