Class: MML::Facility
- Inherits:
-
Object
- Object
- MML::Facility
- Defined in:
- lib/mml/common.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Facility
constructor
A new instance of Facility.
- #to_xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Facility
Returns a new instance of Facility.
178 179 180 181 182 |
# File 'lib/mml/common.rb', line 178 def initialize(args = {}) %W(name id).each do |item| self.send("#{item}=", args[item.to_sym]) end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
176 177 178 |
# File 'lib/mml/common.rb', line 176 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
175 176 177 |
# File 'lib/mml/common.rb', line 175 def name @name end |
Instance Method Details
#to_xml ⇒ Object
189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/mml/common.rb', line 189 def to_xml xb = Builder::XmlMarkup.new xb.mmlFc :Facility do name.each do |n| attributes = {'mmlFc:repCode' => n.repCode} attributes['mmlFc:tableId'] = n.tableId if n.tableId xb.mmlFc :name, n.value, attributes end xb << id.to_xml if id end end |