class Megam::BirrOptions
Attributes
commands[R]
sudo[R]
Public Class Methods
new(&block)
click to toggle source
# File lib/megam/birr_options.rb 27 def initialize(&block) 28 # defaults 29 @tarball = nil 30 @sudo = false 31 @directory = [] 32 @command = [] 33 @commands = [] 34 @start_time = Time.now 35 instance_eval(&block) 36 37 end
setter(*method_names)
click to toggle source
# File lib/megam/birr_options.rb 7 def self.setter(*method_names) 8 method_names.each do |name| 9 send :define_method, name do |data| 10 instance_variable_set "@#{name}".to_sym, data 11 end 12 end 13 end
varargs_setter(*method_names)
click to toggle source
# File lib/megam/birr_options.rb 15 def self.varargs_setter(*method_names) 16 method_names.each do |name| 17 send :define_method, name do |*data| 18 instance_variable_set "@#{name}".to_sym, data 19 end 20 end 21 end
Public Instance Methods
sudo?()
click to toggle source
# File lib/megam/birr_options.rb 43 def sudo? 44 @sudo 45 end
tarball_file()
click to toggle source
# File lib/megam/birr_options.rb 47 def tarball_file 48 @tarball_file ||= @tarball 49 end
to_s()
click to toggle source
# File lib/megam/birr_options.rb 51 def to_s 52 tmps = "" 53 tmps << "sudo :" + @sudo.to_s + "\n" 54 tmps << "dir :" + @directory.to_s + "\n" 55 tmps << "cmd :" + commands.to_s + "\n" 56 tmps << "strt :" + @start_time.to_s 57 end