Class: XRay::CSS::RuleSet
Instance Attribute Summary collapse
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
Instance Method Summary collapse
-
#initialize(selector, declarations) ⇒ RuleSet
constructor
A new instance of RuleSet.
- #position ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(selector, declarations) ⇒ RuleSet
Returns a new instance of RuleSet.
61 62 63 |
# File 'lib/css/struct.rb', line 61 def initialize(selector, declarations) @selector, @declarations = selector, declarations end |
Instance Attribute Details
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
59 60 61 |
# File 'lib/css/struct.rb', line 59 def declarations @declarations end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
59 60 61 |
# File 'lib/css/struct.rb', line 59 def selector @selector end |
Instance Method Details
#position ⇒ Object
73 74 75 |
# File 'lib/css/struct.rb', line 73 def position selector.position end |
#text ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/css/struct.rb', line 65 def text decs_text = declarations.collect { |dec| "#{' ' * 4}#{dec};" }.join("\n") "#{selector} {\n#{decs_text}\n}" end |