Class: MML::Id

Inherits:
Object
  • Object
show all
Defined in:
lib/mml/common.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#checkDigitObject

Returns the value of attribute checkDigit.



59
60
61
# File 'lib/mml/common.rb', line 59

def checkDigit
  @checkDigit
end

#checkDigitSchemaObject

Returns the value of attribute checkDigitSchema.



59
60
61
# File 'lib/mml/common.rb', line 59

def checkDigitSchema
  @checkDigitSchema
end

#tableIdObject

Returns the value of attribute tableId.



58
59
60
# File 'lib/mml/common.rb', line 58

def tableId
  @tableId
end

#typeObject

Returns the value of attribute type.



58
59
60
# File 'lib/mml/common.rb', line 58

def type
  @type
end

#valueObject

Returns the value of attribute value.



58
59
60
# File 'lib/mml/common.rb', line 58

def value
  @value
end

Instance Method Details

#to_xmlObject



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