Class: ReduxGen::CLI

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

Instance Method Summary collapse

Instance Method Details

#new(component, name) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/redux_gen.rb', line 10

def new(component, name)
  Validations.validate component
  Validations.validate_directory_for component
  path = Validations.component_path component, name
  template = Template.new(component, name).render
  open(path, 'w') do |output|
    output.write template
  end
end