Class: Hippo::Command::NamedCommand

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/hippo/command/named_command.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



9
10
11
# File 'lib/hippo/command/named_command.rb', line 9

def class_name
  @class_name
end

#client_dirObject (readonly)

Returns the value of attribute client_dir.



9
10
11
# File 'lib/hippo/command/named_command.rb', line 9

def client_dir
  @client_dir
end

#identifierObject (readonly)

Returns the value of attribute identifier.



9
10
11
# File 'lib/hippo/command/named_command.rb', line 9

def identifier
  @identifier
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



9
10
11
# File 'lib/hippo/command/named_command.rb', line 9

def namespace
  @namespace
end

#spec_dirObject (readonly)

Returns the value of attribute spec_dir.



9
10
11
# File 'lib/hippo/command/named_command.rb', line 9

def spec_dir
  @spec_dir
end

Class Method Details

.source_rootObject



11
12
13
# File 'lib/hippo/command/named_command.rb', line 11

def self.source_root
    Pathname.new(__FILE__).dirname.join("..","..","..","templates")
end

Instance Method Details

#load_namespaceObject



15
16
17
18
# File 'lib/hippo/command/named_command.rb', line 15

def load_namespace
    @identifier = extension.identifier
    @namespace  = options[:namespace] || @identifier.underscore.camelize
end

#set_variablesObject



20
21
22
23
24
# File 'lib/hippo/command/named_command.rb', line 20

def set_variables
    @class_name = name.underscore.camelize
    @spec_dir   = "spec/client"
    @client_dir = "client/#{identifier}"
end