Class: RubyPost::Macros

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

Overview

stores the macros that particular drawbles need. This should really be a private class.

Instance Method Summary collapse

Constructor Details

#initializeMacros

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

#compileObject



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