Class: Sass::Script::Value::Function

Inherits:
Callable show all
Defined in:
lib/sass/script/value/function.rb

Overview

A SassScript object representing a function.

Instance Attribute Summary

Attributes inherited from Base

#options, #source_range, #value

Instance Method Summary collapse

Methods inherited from Callable

#inspect, #to_s

Methods inherited from Base

#==, #_perform, #assert_int!, #bracketed, #div, #eq, #eql?, #hash, #inspect, #minus, #neq, #null?, #plus, #separator, #single_eq, #to_a, #to_bool, #to_h, #to_i, #to_s, #unary_div, #unary_minus, #unary_not, #unary_plus, #with_contents

Constructor Details

#initialize(function) ⇒ Function

Constructs a Function value for use in SassScript.

function is invoked.

Parameters:



8
9
10
11
12
13
# File 'lib/sass/script/value/function.rb', line 8

def initialize(function)
  unless function.type == "function"
    raise ArgumentError.new("A callable of type function was expected.")
  end
  super
end

Instance Method Details

#to_sass



15
16
17
# File 'lib/sass/script/value/function.rb', line 15

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