Class: CssCompare::CSS::Component::Value

Inherits:
Base
  • Object
show all
Defined in:
lib/css_compare/css/component/value.rb

Overview

Represents the value of a CSS property under certain conditions declared by @media queries.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ Value

Returns a new instance of Value.

Parameters:

  • val (Sass::Tree::PropNode)

    the value of the property



11
12
13
# File 'lib/css_compare/css/component/value.rb', line 11

def initialize(val)
  self.value = val
end

Instance Attribute Details

#valueCssCompare::CSS::Value::Base



8
9
10
# File 'lib/css_compare/css/component/value.rb', line 8

def value
  @value
end

Instance Method Details

#==(other) ⇒ Boolean

Checks whether two values are equal. Equal values mean, that the actual value and the importance, as well, are set equally.

Parameters:

Returns:

  • (Boolean)


21
22
23
# File 'lib/css_compare/css/component/value.rb', line 21

def ==(other)
  @value == other.value
end

#equals?(other) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/css_compare/css/component/value.rb', line 25

def equals?(other)
  @value.equals?(other.value)
end

#important?Bool

Tells, whether or not the value is marked as !important

Returns:

  • (Bool)


43
44
45
# File 'lib/css_compare/css/component/value.rb', line 43

def important?
  @is_important
end

#to_sString

Returns the String representation of this node.

Returns:

  • (String)

    the String representation of this node



48
49
50
# File 'lib/css_compare/css/component/value.rb', line 48

def to_s
  @value.to_s
end