Class: RubyPost::Macros
Overview
stores the macros that particular drawbles need. This should really be a private class.
Instance Method Summary collapse
-
#add_input(s) ⇒ Object
uses hash to make sure we never input same thing twice.
- #compile ⇒ Object
-
#initialize ⇒ Macros
constructor
A new instance of Macros.
Constructor Details
#initialize ⇒ Macros
Returns a new instance of Macros.
15 16 17 |
# File 'lib/objects.rb', line 15 def initialize @inputs = Hash.new end |
Instance Method Details
#add_input(s) ⇒ Object
uses hash to make sure we never input same thing twice
20 21 22 |
# File 'lib/objects.rb', line 20 def add_input(s) @inputs[s] = nil end |
#compile ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/objects.rb', line 24 def compile str = String.new @inputs.each_key do |k| str = str + "input " + k + ";\n" end str end |