Class: Xanthus::Script
- Inherits:
-
Object
- Object
- Xanthus::Script
- Defined in:
- lib/xanthus/script.rb
Instance Attribute Summary collapse
-
#script ⇒ Object
Returns the value of attribute script.
Instance Method Summary collapse
-
#initialize(array, config) ⇒ Script
constructor
A new instance of Script.
- #to_s ⇒ Object
Constructor Details
#initialize(array, config) ⇒ Script
Returns a new instance of Script.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/xanthus/script.rb', line 6 def initialize array, config script = '' array.each do |t| v = eval(config.scripts[t]) if v.kind_of?(Array) v.each do |w| script+=w+"\n" end else script+=v end end script_to_clean = script script = '' script_to_clean.each_line do |s| script += s.strip + "\n" unless s=="\n" end script = script.gsub "\n\n", "\n" @script = script end |
Instance Attribute Details
#script ⇒ Object
Returns the value of attribute script.
3 4 5 |
# File 'lib/xanthus/script.rb', line 3 def script @script end |
Instance Method Details
#to_s ⇒ Object
27 28 29 |
# File 'lib/xanthus/script.rb', line 27 def to_s @script end |