Class: Arbitrium::FileCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/arbitrium/file_creator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FileCreator

Returns a new instance of FileCreator.



9
10
11
12
13
14
# File 'lib/arbitrium/file_creator.rb', line 9

def initialize(options)
  @file_with_path = options[:file]
  @method_name    = options[:method_name]
  @pwd            = options[:pwd]
  @module_array   = options[:module_array]
end

Instance Attribute Details

#file_with_pathObject (readonly)

Returns the value of attribute file_with_path.



3
4
5
# File 'lib/arbitrium/file_creator.rb', line 3

def file_with_path
  @file_with_path
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



3
4
5
# File 'lib/arbitrium/file_creator.rb', line 3

def method_name
  @method_name
end

#module_arrayObject (readonly)

Returns the value of attribute module_array.



3
4
5
# File 'lib/arbitrium/file_creator.rb', line 3

def module_array
  @module_array
end

#pwdObject (readonly)

Returns the value of attribute pwd.



3
4
5
# File 'lib/arbitrium/file_creator.rb', line 3

def pwd
  @pwd
end

Class Method Details

.perform(options) ⇒ Object



5
6
7
# File 'lib/arbitrium/file_creator.rb', line 5

def self.perform(options)
  new(options).perform
end

Instance Method Details

#performObject



16
17
18
# File 'lib/arbitrium/file_creator.rb', line 16

def perform
  puts create_file ? "Successfully created file in #{full_path_with_file}" : "Failed to create file!"
end