Class: Slaw::Grammars::ZA::Act::Act
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Slaw::Grammars::ZA::Act::Act
- Defined in:
- lib/slaw/grammars/za/act_nodes.rb
Constant Summary collapse
- FRBR_URI =
'/za/act/1980/01'
- WORK_URI =
FRBR_URI
- EXPRESSION_URI =
"#{FRBR_URI}/eng@"
- MANIFESTATION_URI =
EXPRESSION_URI
Instance Method Summary collapse
- #to_xml(b, idprefix = nil, i = 0) ⇒ Object
- #write_body(b) ⇒ Object
- #write_identification(b) ⇒ Object
- #write_meta(b) ⇒ Object
- #write_preamble(b) ⇒ Object
- #write_preface(b) ⇒ Object
- #write_schedules(b) ⇒ Object
Instance Method Details
#to_xml(b, idprefix = nil, i = 0) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 14 def to_xml(b, idprefix=nil, i=0) b.act(contains: "originalVersion") { |b| (b) write_preface(b) write_preamble(b) write_body(b) } write_schedules(b) end |
#write_body(b) ⇒ Object
70 71 72 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 70 def write_body(b) body.to_xml(b) end |
#write_identification(b) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 35 def write_identification(b) b.identification(source: "#slaw") { |b| # use stub values so that we can generate a validating document b.FRBRWork { |b| b.FRBRthis(value: "#{WORK_URI}/main") b.FRBRuri(value: WORK_URI) b.FRBRalias(value: 'Short Title') b.FRBRdate(date: '1980-01-01', name: 'Generation') b.FRBRauthor(href: '#council') b.FRBRcountry(value: 'za') } b.FRBRExpression { |b| b.FRBRthis(value: "#{EXPRESSION_URI}/main") b.FRBRuri(value: EXPRESSION_URI) b.FRBRdate(date: '1980-01-01', name: 'Generation') b.FRBRauthor(href: '#council') b.FRBRlanguage(language: 'eng') } b.FRBRManifestation { |b| b.FRBRthis(value: "#{MANIFESTATION_URI}/main") b.FRBRuri(value: MANIFESTATION_URI) b.FRBRdate(date: Time.now.strftime('%Y-%m-%d'), name: 'Generation') b.FRBRauthor(href: '#slaw') } } end |
#write_meta(b) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 24 def (b) b. { |b| write_identification(b) b.references(source: "#this") { b.TLCOrganization(id: 'slaw', href: 'https://github.com/longhotsummer/slaw', showAs: "Slaw") b.TLCOrganization(id: 'council', href: '/ontology/organization/za/council', showAs: "Council") } } end |
#write_preamble(b) ⇒ Object
66 67 68 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 66 def write_preamble(b) preamble.to_xml(b) if preamble.respond_to? :to_xml end |
#write_preface(b) ⇒ Object
62 63 64 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 62 def write_preface(b) preface.to_xml(b) if preface.respond_to? :to_xml end |
#write_schedules(b) ⇒ Object
74 75 76 77 78 |
# File 'lib/slaw/grammars/za/act_nodes.rb', line 74 def write_schedules(b) if schedules.text_value != "" schedules.to_xml(b) end end |