Sha256: 053318fc029145e53c8a5956af3981da86d09628ee92802f4daf54a4d7a84351

Contents?: true

Size: 561 Bytes

Versions: 32

Compression:

Stored size: 561 Bytes

Contents

module Sass::Script
  class UnaryOperation # :nodoc:
    def initialize(operand, operator)
      @operand = operand
      @operator = operator
    end

    def inspect
      "(#{@operator.inspect} #{@operand.inspect})"
    end

    def perform(environment)
      operator = "unary_#{@operator}"
      literal = @operand.perform(environment)
      literal.send(operator)
    rescue NoMethodError => e
      raise e unless e.name.to_s == operator.to_s
      raise Sass::SyntaxError.new("Undefined unary operation: \"#{@operator} #{literal}\".")
    end
  end
end

Version data entries

32 entries across 32 versions & 7 rubygems

Version Path
gohanlonllc-haml-2.1.0.20080513000000 lib/sass/script/unary_operation.rb
gohanlonllc-haml-2.1.0 lib/sass/script/unary_operation.rb
honkster-haml-2.1.0 lib/sass/script/unary_operation.rb
honkster-haml-2.1.1 lib/sass/script/unary_operation.rb
jwhitmire-haml-2.1.0.1 lib/sass/script/unary_operation.rb
jwhitmire-haml-2.1.0.2 lib/sass/script/unary_operation.rb
jwhitmire-haml-2.1.0.3 lib/sass/script/unary_operation.rb
wireframe-haml-2.1.0 lib/sass/script/unary_operation.rb
wireframe-haml-2.1.1 lib/sass/script/unary_operation.rb
haml-edge-2.1.1 lib/sass/script/unary_operation.rb
haml-edge-2.1.10 lib/sass/script/unary_operation.rb
haml-edge-2.1.11 lib/sass/script/unary_operation.rb
haml-edge-2.1.12 lib/sass/script/unary_operation.rb
haml-edge-2.1.18 lib/sass/script/unary_operation.rb
haml-edge-2.1.19 lib/sass/script/unary_operation.rb
haml-edge-2.1.2 lib/sass/script/unary_operation.rb
haml-edge-2.1.20 lib/sass/script/unary_operation.rb
haml-edge-2.1.21 lib/sass/script/unary_operation.rb
haml-edge-2.1.4 lib/sass/script/unary_operation.rb
haml-edge-2.1.5 lib/sass/script/unary_operation.rb