Class: NormalizeXml::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/normalizexml/controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeController

Returns a new instance of Controller.



23
24
25
26
27
28
29
# File 'lib/normalizexml/controller.rb', line 23

def initialize()
	$LOG.debug "Controller::initialize"
	@cfg 			= Config.new.load
	@someFlag 		= false
	@model 			= Parser.new
	@model.verbose 	= false
end

Instance Attribute Details

#modelObject

Returns the value of attribute model.



20
21
22
# File 'lib/normalizexml/controller.rb', line 20

def model
  @model
end

#someFlagObject

Returns the value of attribute someFlag.



19
20
21
# File 'lib/normalizexml/controller.rb', line 19

def someFlag
  @someFlag
end

#verbose(arg) ⇒ Object

Returns the value of attribute verbose.



21
22
23
# File 'lib/normalizexml/controller.rb', line 21

def verbose
  @verbose
end

Instance Method Details

#doSomethingWithCmdLineArg(arg) ⇒ Object



60
61
62
63
64
# File 'lib/normalizexml/controller.rb', line 60

def doSomethingWithCmdLineArg(arg)
	$LOG.debug "Controller::doSomethingWithCmdLineArg( #{arg} )"
	#raise ArgumentError.new("Unexpected argument: #{arg}")
	return true		# I want cmd line args
end

#doSomethingWithSwitch(arg) ⇒ Object



55
56
57
# File 'lib/normalizexml/controller.rb', line 55

def doSomethingWithSwitch(arg)
	$LOG.debug "Controller::doSomethingWithSwitch( #{arg} )"
end

#infile=(infile) ⇒ Object



45
46
47
# File 'lib/normalizexml/controller.rb', line 45

def infile=(infile)
	@model.infile = infile
end

#noCmdLineArgObject

Raises:

  • (ArgumentError)


67
68
69
70
71
# File 'lib/normalizexml/controller.rb', line 67

def noCmdLineArg()
	$LOG.debug "Controller::noCmdLineArg"
	raise ArgumentError.new("Argument expected.")
	return false			# No arg, no worky.
end

#normalizeObject



74
75
76
77
# File 'lib/normalizexml/controller.rb', line 74

def normalize()
	$LOG.debug "Controller::normalize"
	@model.normalize()
end

#outfile=(outfile) ⇒ Object



50
51
52
# File 'lib/normalizexml/controller.rb', line 50

def outfile=(outfile)
	@model.outfile = outfile
end