Class: MML::Id
- Inherits:
-
Object
- Object
- MML::Id
- Defined in:
- lib/mml/common.rb
Instance Attribute Summary collapse
-
#checkDigit ⇒ Object
Returns the value of attribute checkDigit.
-
#checkDigitSchema ⇒ Object
Returns the value of attribute checkDigitSchema.
-
#tableId ⇒ Object
Returns the value of attribute tableId.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Id
constructor
A new instance of Id.
- #to_xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Id
Returns a new instance of Id.
61 62 63 64 65 66 67 |
# File 'lib/mml/common.rb', line 61 def initialize(args = {}) self.value = args[:value] self.type = args[:type] self.tableId = args[:tableId] self.checkDigit = args[:checkDigit] self.checkDigitSchema = args[:checkDigitSchema] end |
Instance Attribute Details
#checkDigit ⇒ Object
Returns the value of attribute checkDigit.
59 60 61 |
# File 'lib/mml/common.rb', line 59 def checkDigit @checkDigit end |
#checkDigitSchema ⇒ Object
Returns the value of attribute checkDigitSchema.
59 60 61 |
# File 'lib/mml/common.rb', line 59 def checkDigitSchema @checkDigitSchema end |
#tableId ⇒ Object
Returns the value of attribute tableId.
58 59 60 |
# File 'lib/mml/common.rb', line 58 def tableId @tableId end |
#type ⇒ Object
Returns the value of attribute type.
58 59 60 |
# File 'lib/mml/common.rb', line 58 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
58 59 60 |
# File 'lib/mml/common.rb', line 58 def value @value end |
Instance Method Details
#to_xml ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/mml/common.rb', line 84 def to_xml xb = Builder::XmlMarkup.new attributes = {'mmlCm:type' => type, 'mmlCm:tableId' => tableId } attributes['mmlCm:checkDigit'] = checkDigit if checkDigit attributes['mmlCm:checkDigitSchema'] = checkDigitSchema if checkDigitSchema xb.mmlCm :Id, value, attributes end |