Class: MirrorMirror::Transformation::PropertyTransformation

Inherits:
Base
  • Object
show all
Defined in:
lib/mirror-mirror/transformation/property_transformation.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited

Class Method Details

.instancesObject

The singleton instances, one for each transformation class



4
5
6
7
# File 'lib/mirror-mirror/transformation/property_transformation.rb', line 4

def self.instances
  super.
    select {|i| i.is_a?(PropertyTransformation) && i.class != PropertyTransformation}
end

Instance Method Details

#transform_expression(property, expression) ⇒ Sass::Script::Node

It is safe for this method to mutate the expression that is passed to it.

Parameters:

  • property (String)

    The property whose value is being transformed. Any prefix/hacks should be removed from the property name.

  • expression (Sass::Script::Node)

    The value being transformed.

Returns:

  • (Sass::Script::Node)

    A new expression for the property



46
47
48
# File 'lib/mirror-mirror/transformation/property_transformation.rb', line 46

def transform_expression(property, expression)
  return expression
end

#transform_expression?(name) ⇒ Boolean

Parameters:

  • name (String)

    The property name

Returns:

  • (Boolean)


28
29
30
# File 'lib/mirror-mirror/transformation/property_transformation.rb', line 28

def transform_expression?(name)
  false
end

#transform_name(name) ⇒ Object

Parameters:

  • name (String)

    The property name



16
17
18
# File 'lib/mirror-mirror/transformation/property_transformation.rb', line 16

def transform_name(name)
  name
end

#transform_name?(name) ⇒ Boolean

Parameters:

  • name (String)

    The property name

Returns:

  • (Boolean)


11
12
13
# File 'lib/mirror-mirror/transformation/property_transformation.rb', line 11

def transform_name?(name)
  false
end

#transform_value(property, value) ⇒ String

Returns A new value for the property.

Parameters:

  • property (String)

    The property whose value is being transformed. Any prefix/hacks should be removed from the property name.

  • value (String)

    The value being transformed.

Returns:

  • (String)

    A new value for the property



36
37
38
# File 'lib/mirror-mirror/transformation/property_transformation.rb', line 36

def transform_value(property, value)
  value
end

#transform_value?(name) ⇒ Boolean

Parameters:

  • name (String)

    The property name

Returns:

  • (Boolean)


22
23
24
# File 'lib/mirror-mirror/transformation/property_transformation.rb', line 22

def transform_value?(name)
  false
end