Class: Lanes::Command::GenerateComponent
- Inherits:
-
NamedCommand
- Object
- Thor::Group
- NamedCommand
- Lanes::Command::GenerateComponent
- Defined in:
- lib/lanes/command/generate_component.rb
Instance Attribute Summary collapse
-
#component_class ⇒ Object
readonly
Returns the value of attribute component_class.
Attributes inherited from NamedCommand
#class_name, #client_dir, #identifier, #namespace, #spec_dir
Instance Method Summary collapse
Methods inherited from NamedCommand
Instance Attribute Details
#component_class ⇒ Object (readonly)
Returns the value of attribute component_class.
11 12 13 |
# File 'lib/lanes/command/generate_component.rb', line 11 def component_class @component_class end |
Instance Method Details
#create_component ⇒ Object
18 19 20 21 22 |
# File 'lib/lanes/command/generate_component.rb', line 18 def create_component template "client/components/Component.cjsx", "#{client_dir}/components/#{class_name}.cjsx" template "spec/client/components/ComponentSpec.coffee", \ "#{spec_dir}/components/#{class_name}Spec.coffee" end |
#set_variables ⇒ Object
13 14 15 16 |
# File 'lib/lanes/command/generate_component.rb', line 13 def set_variables super @component_class = "#{namespace}.Components.#{class_name}" end |