Class: Guideline

Inherits:
Object
  • Object
show all
Defined in:
lib/xmlutils/gdlcontextobjs.rb

Overview

class Guideline

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Guideline

Returns a new instance of Guideline.



246
247
248
249
250
251
252
# File 'lib/xmlutils/gdlcontextobjs.rb', line 246

def initialize(attributes)
  @id         = attributes["GuidelineID"]
  @name       = attributes["Name"]
  @version    = attributes["Version"]
  @startDate  = attributes["StartDate"]
  @items      = Array.new
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



239
240
241
# File 'lib/xmlutils/gdlcontextobjs.rb', line 239

def id
  @id
end

#itemsObject

Returns the value of attribute items.



243
244
245
# File 'lib/xmlutils/gdlcontextobjs.rb', line 243

def items
  @items
end

#nameObject

Returns the value of attribute name.



240
241
242
# File 'lib/xmlutils/gdlcontextobjs.rb', line 240

def name
  @name
end

#startDateObject

Returns the value of attribute startDate.



242
243
244
# File 'lib/xmlutils/gdlcontextobjs.rb', line 242

def startDate
  @startDate
end

#versionObject

Returns the value of attribute version.



241
242
243
# File 'lib/xmlutils/gdlcontextobjs.rb', line 241

def version
  @version
end

Instance Method Details

#addItem(itemAry) ⇒ Object

initialize



254
255
256
257
258
259
260
# File 'lib/xmlutils/gdlcontextobjs.rb', line 254

def addItem(itemAry)
  if (itemAry[0] == "rule" || itemAry[0] == "ruleset")
    items.push(itemAry)
  else
    raise "Invalid arg: expected rule or ruleset type"
  end # if
end