class ODT2HTML::DeclarationBlock

Represents a CSS declaration block; a sequence of zero or more +Declaration+s.

Attributes

block_used[RW]

Public Class Methods

new(*arglist) click to toggle source
Calls superclass method
# File lib/odt2html/declaration_block.rb, line 7
def initialize(*arglist)
  if (arglist[0].kind_of? DeclarationBlock) then
    dblock = arglist[0]
    super( 0 )
    dblock.each do |item|
      push Declaration.new( item.property, item.value )
    end
  else
    super
  end
  @block_used = false
end

Public Instance Methods

has_top_border?() click to toggle source
# File lib/odt2html/declaration_block.rb, line 20
def has_top_border?
result = detect {|item| item.property =~ /border(-top)?/}
  return (result != nil) ? true : nil
end
to_s() click to toggle source
# File lib/odt2html/declaration_block.rb, line 25
def to_s
  result = "{\n"
  sort{|a,b| a.property <=> b.property }.each { |item|
    result << "\t#{item.property}: #{item.value};\n"
  }
  result << "}\n"
  return result
end