Class: Megam::BirrOptions
- Inherits:
-
Object
- Object
- Megam::BirrOptions
- Defined in:
- lib/megam/birr_options.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#sudo ⇒ Object
readonly
Returns the value of attribute sudo.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(&block) ⇒ BirrOptions
constructor
A new instance of BirrOptions.
- #sudo? ⇒ Boolean
- #tarball_file ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(&block) ⇒ BirrOptions
Returns a new instance of BirrOptions.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/megam/birr_options.rb', line 27 def initialize(&block) # defaults @tarball = nil @sudo = false @directory = [] @command = [] @commands = [] @start_time = Time.now instance_eval(&block) end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
25 26 27 |
# File 'lib/megam/birr_options.rb', line 25 def commands @commands end |
#sudo ⇒ Object (readonly)
Returns the value of attribute sudo.
25 26 27 |
# File 'lib/megam/birr_options.rb', line 25 def sudo @sudo end |
Class Method Details
.setter(*method_names) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/megam/birr_options.rb', line 7 def self.setter(*method_names) method_names.each do |name| send :define_method, name do |data| instance_variable_set "@#{name}".to_sym, data end end end |
.varargs_setter(*method_names) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/megam/birr_options.rb', line 15 def self.varargs_setter(*method_names) method_names.each do |name| send :define_method, name do |*data| instance_variable_set "@#{name}".to_sym, data end end end |
Instance Method Details
#sudo? ⇒ Boolean
43 44 45 |
# File 'lib/megam/birr_options.rb', line 43 def sudo? @sudo end |
#tarball_file ⇒ Object
47 48 49 |
# File 'lib/megam/birr_options.rb', line 47 def tarball_file @tarball_file ||= @tarball end |
#to_s ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/megam/birr_options.rb', line 51 def to_s tmps = "" tmps << "sudo :" + @sudo.to_s + "\n" tmps << "dir :" + @directory.to_s + "\n" tmps << "cmd :" + commands.to_s + "\n" tmps << "strt :" + @start_time.to_s end |