Class: Swiftfake::Runner
- Inherits:
-
Object
- Object
- Swiftfake::Runner
- Defined in:
- lib/swiftfake.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(args:, config: Config.create) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
16 17 18 |
# File 'lib/swiftfake.rb', line 16 def args @args end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
16 17 18 |
# File 'lib/swiftfake.rb', line 16 def config @config end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/swiftfake.rb', line 23 def run source_file, structure_json = config.source_reader.read_file(args[:input]) parser = config.parser_klass.new swift_class = parser.parse(source_file, structure_json) presenter = config.presenter_klass.new(swift_class) config.renderer.output(presenter) end |