Class: RelatonBib::Address
- Inherits:
-
Object
- Object
- RelatonBib::Address
- Defined in:
- lib/relaton_bib/contributor.rb
Overview
Address class.
Instance Attribute Summary collapse
- #city ⇒ String readonly
- #country ⇒ String readonly
- #postcode ⇒ String, NilClass readonly
- #state ⇒ String, NilClass readonly
- #street ⇒ Array<String> readonly
Instance Method Summary collapse
-
#initialize(street:, city:, state: nil, country:, postcode: nil) ⇒ Address
constructor
A new instance of Address.
- #to_xml(doc) ⇒ Object
Constructor Details
#initialize(street:, city:, state: nil, country:, postcode: nil) ⇒ Address
54 55 56 57 58 59 60 |
# File 'lib/relaton_bib/contributor.rb', line 54 def initialize(street:, city:, state: nil, country:, postcode: nil) @street = street @city = city @state = state @country = country @postcode = postcode end |
Instance Attribute Details
#city ⇒ String (readonly)
38 39 40 |
# File 'lib/relaton_bib/contributor.rb', line 38 def city @city end |
#country ⇒ String (readonly)
44 45 46 |
# File 'lib/relaton_bib/contributor.rb', line 44 def country @country end |
#postcode ⇒ String, NilClass (readonly)
47 48 49 |
# File 'lib/relaton_bib/contributor.rb', line 47 def postcode @postcode end |
#state ⇒ String, NilClass (readonly)
41 42 43 |
# File 'lib/relaton_bib/contributor.rb', line 41 def state @state end |
#street ⇒ Array<String> (readonly)
35 36 37 |
# File 'lib/relaton_bib/contributor.rb', line 35 def street @street end |
Instance Method Details
#to_xml(doc) ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'lib/relaton_bib/contributor.rb', line 63 def to_xml(doc) doc.address do street.each { |str| doc.street str } doc.city city doc.state state if state doc.country country doc.postcode postcode if postcode end end |