Class: FileRenamer::NameAlterer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNameAlterer

Returns a new instance of NameAlterer.



9
10
11
12
13
# File 'lib/name_alterer.rb', line 9

def initialize
  @filename
  @number
  @name
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



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

def number
  @number
end

Instance Method Details

#renamed_filename(args) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/name_alterer.rb', line 15

def renamed_filename(args)
  @filename = args[:filename]
  @number   = args[:number]
  @name     = args[:new_name]

  name_with_extension
end