Class: Habaki::SupportsRule

Inherits:
Rule show all
Defined in:
lib/habaki/supports_rule.rb

Overview

supports rule @supports

Instance Attribute Summary collapse

Attributes inherited from Rule

#stylesheet

Instance Method Summary collapse

Methods inherited from Rule

#declarations, #each_declaration, #each_selector, #element_match?, #selectors

Methods inherited from Node

#to_s

Constructor Details

#initializeSupportsRule

Returns a new instance of SupportsRule.



48
49
50
# File 'lib/habaki/supports_rule.rb', line 48

def initialize
  @rules = Rules.new
end

Instance Attribute Details

#expressionSupportsExpression

Returns:



44
45
46
# File 'lib/habaki/supports_rule.rb', line 44

def expression
  @expression
end

#rulesRules

Returns:



46
47
48
# File 'lib/habaki/supports_rule.rb', line 46

def rules
  @rules
end

Instance Method Details

#read_from_katana(rule) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:



60
61
62
63
# File 'lib/habaki/supports_rule.rb', line 60

def read_from_katana(rule)
  @expression = SupportsExpression.read_from_katana(rule.expression)
  @rules = Rules.read_from_katana(rule.rules)
end

#string(format = Formatter::Base.new) ⇒ String

Returns:



53
54
55
# File 'lib/habaki/supports_rule.rb', line 53

def string(format = Formatter::Base.new)
  "@supports #{@expression.string(format)} {\n#{@rules.string(format + 1)}\n}"
end