Class: Konjak::Header

Inherits:
StructuralElement show all
Defined in:
lib/konjak/header.rb

Constant Summary collapse

TAG_NAME =
'header'

Instance Method Summary collapse

Methods inherited from Element

#__getobj__, #initialize

Constructor Details

This class inherits a constructor from Konjak::Element

Instance Method Details

#can_contain?(element) ⇒ Boolean

methods

Returns:

  • (Boolean)


35
36
37
# File 'lib/konjak/header.rb', line 35

def can_contain?(element)
  [Note, UserDefinedEncoding, Property].any? {|c| c === element }
end

#notesObject

childrens



22
23
24
# File 'lib/konjak/header.rb', line 22

def notes
  children.select {|c| c.name == Note::TAG_NAME }.map! {|n| Note.new(n) }
end

#propertiesObject



30
31
32
# File 'lib/konjak/header.rb', line 30

def properties
  children.select {|c| c.name == Property::TAG_NAME }.map! {|n| Property.new(n) }
end

#user_defined_encodingsObject



26
27
28
# File 'lib/konjak/header.rb', line 26

def user_defined_encodings
  children.select {|c| c.name == UserDefinedEncoding::TAG_NAME }.map! {|n| UserDefinedEncoding.new(n) }
end