Class: Sass::Script::Funcall
Overview
:nodoc:
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, args) ⇒ Funcall
constructor
A new instance of Funcall.
- #inspect ⇒ Object
- #perform(environment) ⇒ Object
Constructor Details
#initialize(name, args) ⇒ Funcall
Returns a new instance of Funcall.
6 7 8 9 |
# File 'lib/sass/script/funcall.rb', line 6 def initialize(name, args) @name = name @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/sass/script/funcall.rb', line 4 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/sass/script/funcall.rb', line 4 def name @name end |
Instance Method Details
#inspect ⇒ Object
11 12 13 |
# File 'lib/sass/script/funcall.rb', line 11 def inspect "#{name}(#{args.map {|a| a.inspect}.join(', ')})" end |
#perform(environment) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sass/script/funcall.rb', line 15 def perform(environment) args = self.args.map {|a| a.perform(environment)} unless Haml::Util.has?(:public_instance_method, Functions, name) && name !~ /^__/ return Script::String.new("#{name}(#{args.map {|a| a.perform(environment)}.join(', ')})") end return Functions.send(name, *args) rescue ArgumentError => e raise e unless e.backtrace.first =~ /:in `(#{name}|perform)'$/ raise Sass::SyntaxError.new("#{e.} for `#{name}'") end |