Method: CItem#initialize
- Defined in:
- lib/coursegen/course/data/citem.rb
#initialize(nitem = nil, ident = nil, type = nil, order = nil) ⇒ CItem
Callable with nitem=nil to create a mock
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/coursegen/course/data/citem.rb', line 13 def initialize nitem=nil, ident=nil, type=nil, order=nil if nitem != nil raise ArgumentError, "invalid CItem contruction" unless ident.nil? @nitem = nitem defaults_from_nitem @nitem parse_identifier @nitem.identifier else raise ArgumentError, "invalid CItem contruction" unless nitem.nil? @nitem = nil @status = nil @type = type @identifier = ident @order = order @title = ident @style = nil parse_identifier(ident) end end |