Class: Gemsmith::Skeletons::BaseSkeleton
- Inherits:
-
Object
- Object
- Gemsmith::Skeletons::BaseSkeleton
show all
- Defined in:
- lib/gemsmith/skeletons/base_skeleton.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseSkeleton.
4
5
6
|
# File 'lib/gemsmith/skeletons/base_skeleton.rb', line 4
def initialize cli
@cli = cli
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/gemsmith/skeletons/base_skeleton.rb', line 20
def method_missing name, *args, &block
if respond_to?(name)
@cli.public_send name, *args, &block
else
super name, *args, &block
end
end
|
Class Method Details
.run(cli) ⇒ Object
8
9
10
|
# File 'lib/gemsmith/skeletons/base_skeleton.rb', line 8
def self.run cli
self.new(cli).create
end
|
Instance Method Details
#create ⇒ Object
12
13
14
|
# File 'lib/gemsmith/skeletons/base_skeleton.rb', line 12
def create
public_methods.each { |method| public_send(method) if method =~ /^create_.+$/ }
end
|
#respond_to?(name, include_private = false) ⇒ Boolean
16
17
18
|
# File 'lib/gemsmith/skeletons/base_skeleton.rb', line 16
def respond_to? name, include_private = false
@cli.respond_to?(name, include_private) || super(name, include_private)
end
|