Class: RXaal::Metadata
Constant Summary
collapse
- @@DEFAULT_LANG =
"en-us"
Instance Attribute Summary collapse
Attributes inherited from XaalElement
#doc, #id, #refs
Instance Method Summary
collapse
included
#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_homepage ⇒ Object
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?)
metadata = Element.new "metadata"
parent.add metadata
end
end
|