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.
7 8 9 10 |
# File 'lib/sass/script/funcall.rb', line 7 def initialize(name, args) @name = name @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/sass/script/funcall.rb', line 5 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/sass/script/funcall.rb', line 5 def name @name end |
Instance Method Details
#inspect ⇒ Object
12 13 14 |
# File 'lib/sass/script/funcall.rb', line 12 def inspect "#{name}(#{args.map {|a| a.inspect}.join(', ')})" end |
#perform(environment) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sass/script/funcall.rb', line 16 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::EvaluationContext.new(environment.).send(name, *args) rescue ArgumentError => e raise e unless e.backtrace.first =~ /:in `(#{name}|perform)'$/ raise Sass::SyntaxError.new("#{e.} for `#{name}'") end |