Class: Slaw::ByLaw
Overview
An extension of Act which wraps an AkomaNtoso XML document describing an By-Law.
There are minor differences between Acts and By-laws, the most notable being that a by-law is not identified by a year and a number, and therefore has a different FRBR uri structure.
Constant Summary
Constants included from Namespace
Instance Attribute Summary collapse
-
#name ⇒ Object
- String
-
A short file-like name of this by-law, unique within its year and region.
-
#region ⇒ Object
- String
-
The code of the region this by-law applies to.
Attributes inherited from Act
#body, #doc, #filename, #id_uri, #meta, #mtime, #nature, #schema, #year
Attributes inherited from AknBase
Instance Method Summary collapse
-
#num ⇒ Object
ByLaws don’t have numbers, use their short-name instead.
- #title ⇒ Object
Methods inherited from Act
#amended?, #amended_by!, #amendment_events, #chapters, #chapters?, #date, #date=, #definitions, for_node, #initialize, #inspect, #load, #manifestation_date, #parts, #parts?, #publication, #published!, #repeal, #repealed?, #repealed_by, #repealed_on, #schedules, #sections, #term_definitions, #title=, #validate, #validates?
Methods inherited from AknBase
Constructor Details
This class inherits a constructor from Slaw::Act
Instance Attribute Details
#name ⇒ Object
- String
-
A short file-like name of this by-law, unique within its year and region
14 15 16 |
# File 'lib/slaw/bylaw.rb', line 14 def name @name end |
#region ⇒ Object
- String
-
The code of the region this by-law applies to
11 12 13 |
# File 'lib/slaw/bylaw.rb', line 11 def region @region end |
Instance Method Details
#num ⇒ Object
ByLaws don’t have numbers, use their short-name instead
17 18 19 |
# File 'lib/slaw/bylaw.rb', line 17 def num name end |
#title ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/slaw/bylaw.rb', line 21 def title node = @meta.at_xpath('./a:identification/a:FRBRWork/a:FRBRalias', a: NS) title = node ? node['value'] : "(Unknown)" if amended? and not title.end_with?("as amended") title = title + " as amended" end title end |