Class: Habaki::PageRule

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

Overview

page rule @page

Instance Attribute Summary collapse

Attributes inherited from Rule

#stylesheet

Instance Method Summary collapse

Methods inherited from Rule

#each_declaration, #each_selector, #element_match?, #rules, #selectors

Methods inherited from Node

#to_s

Constructor Details

#initializePageRule

Returns a new instance of PageRule.



7
8
9
# File 'lib/habaki/page_rule.rb', line 7

def initialize
  @declarations = Declarations.new
end

Instance Attribute Details

#declarationsDeclarations

Returns:



5
6
7
# File 'lib/habaki/page_rule.rb', line 5

def declarations
  @declarations
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:



20
21
22
# File 'lib/habaki/page_rule.rb', line 20

def read_from_katana(rule)
  @declarations = Declarations.read_from_katana(rule.declarations)
end

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

Parameters:

Returns:



13
14
15
# File 'lib/habaki/page_rule.rb', line 13

def string(format = Formatter::Base.new)
  "@page {#{@declarations.string(format + 1)}}"
end