Class: Penman::SeedCode
- Inherits:
-
Object
- Object
- Penman::SeedCode
- Defined in:
- lib/penman/seed_code.rb
Instance Method Summary collapse
- #<<(seed_line) ⇒ Object
-
#initialize(seed_code = []) ⇒ SeedCode
constructor
A new instance of SeedCode.
- #print_with_leading_spaces(num_spaces) ⇒ Object
- #print_with_leading_tabs(num_tabs) ⇒ Object
Constructor Details
#initialize(seed_code = []) ⇒ SeedCode
Returns a new instance of SeedCode.
3 4 5 |
# File 'lib/penman/seed_code.rb', line 3 def initialize(seed_code = []) @seed_code = seed_code end |
Instance Method Details
#<<(seed_line) ⇒ Object
7 8 9 |
# File 'lib/penman/seed_code.rb', line 7 def << (seed_line) @seed_code << seed_line end |
#print_with_leading_spaces(num_spaces) ⇒ Object
11 12 13 14 |
# File 'lib/penman/seed_code.rb', line 11 def print_with_leading_spaces(num_spaces) spaces = "\n" + ' ' * num_spaces @seed_code.join(spaces) end |
#print_with_leading_tabs(num_tabs) ⇒ Object
16 17 18 19 |
# File 'lib/penman/seed_code.rb', line 16 def print_with_leading_tabs(num_tabs) tabs = "\n" + "\t" * num_tabs @seed_code.join(tabs) end |