Class: XRay::CSS::Declaration

Inherits:
Node
  • Object
show all
Defined in:
lib/css/struct.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property, value) ⇒ Declaration

Returns a new instance of Declaration.



97
98
99
# File 'lib/css/struct.rb', line 97

def initialize(property, value)
  @property, @value = property, value
end

Instance Attribute Details

#propertyObject (readonly)

Returns the value of attribute property.



95
96
97
# File 'lib/css/struct.rb', line 95

def property
  @property
end

#valueObject (readonly)

Returns the value of attribute value.



95
96
97
# File 'lib/css/struct.rb', line 95

def value
  @value
end

Instance Method Details

#positionObject



105
106
107
# File 'lib/css/struct.rb', line 105

def position
  property.position
end

#textObject



101
102
103
# File 'lib/css/struct.rb', line 101

def text
  "#{property}: #{value}"
end