Class: RXaal::Metadata

Inherits:
TopLevelElem show all
Includes:
MetadataMod
Defined in:
lib/metadata.rb

Constant Summary collapse

@@DEFAULT_LANG =
"en-us"

Instance Attribute Summary collapse

Attributes inherited from XaalElement

#doc, #id, #refs

Instance Method Summary collapse

Methods included from MetadataMod

included

Methods inherited from TopLevelElem

#superclass_serialize

Methods inherited from XaalElement

#add_attribute, #add_ref, get_new_default_id, modify_ref, #rm_ref, #superclass_serialize

Constructor Details

#initialize(doc) ⇒ Metadata

Returns a new instance of Metadata.



7
8
9
10
11
12
13
14
15
# File 'lib/metadata.rb', line 7

def initialize(doc)
  super(doc)
  @@DEFAULT_LANG.freeze
  @titles = Hash.new
  @subjects = Hash.new
  @keywords = Hash.new
  @descs = Hash.new
  @serialize = false
end

Instance Attribute Details

#app_homepageObject

we check if its actually a uri



21
22
23
# File 'lib/metadata.rb', line 21

def app_homepage
  @app_homepage
end

Instance Method Details

#add_desc(title, lang) ⇒ Object



57
58
59
# File 'lib/metadata.rb', line 57

def add_desc(desc)
  add_desc(desc, @@DEFAULT_LANG)
end

#add_keyword(title, lang) ⇒ Object



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

def add_keyword(keyword)
  add_keyword(keyword, @@DEFAULT_LANG)
end

#add_subject(title, lang) ⇒ Object



39
40
41
# File 'lib/metadata.rb', line 39

def add_subject(subject)
  add_subject(subject, @@DEFAULT_LANG)
end

#add_title(title, lang) ⇒ Object



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

def add_title(subject)
  add_title(title, @@DEFAULT_LANG)
end

#xaal_serialize(parent) ⇒ Object



66
67
68
69
70
71
# File 'lib/metadata.rb', line 66

def xaal_serialize(parent)
  if (serialize?)
     = Element.new "metadata"
    parent.add 
  end
end