Class: SsSyntax::CommandBuilder
- Inherits:
-
Object
- Object
- SsSyntax::CommandBuilder
- Defined in:
- lib/ss_syntax/command_builder.rb
Instance Method Summary collapse
-
#initialize(arguments = ARGV) ⇒ CommandBuilder
constructor
A new instance of CommandBuilder.
- #parse ⇒ Object
Constructor Details
#initialize(arguments = ARGV) ⇒ CommandBuilder
Returns a new instance of CommandBuilder.
6 7 8 9 |
# File 'lib/ss_syntax/command_builder.rb', line 6 def initialize(arguments = ARGV) @arguments = arguments @options = end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ss_syntax/command_builder.rb', line 11 def parse file_path = ARGV[0] return puts 'Please set ss file.' if file_path == nil file = File.open(file_path, 'r') text = file.read if @options[:html] puts Parse.new(text).to_h else puts Parse.new(text).to_s end end |