Class: Algerb::File

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/algerb/file.rb

Constant Summary collapse

FILE_PATTERN =
%r{/?(a-z0-9\-_\.)$}i

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util

#file_to_class, #indentation, #remove_dir, #remove_ext, #split_dir_and_file, #split_path_as_head_and_tail

Constructor Details

#initialize(name) ⇒ File

Returns a new instance of File.



8
9
10
# File 'lib/algerb/file.rb', line 8

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/algerb/file.rb', line 6

def name
  @name
end

Instance Method Details

#==(another) ⇒ Object



16
17
18
# File 'lib/algerb/file.rb', line 16

def ==(another)
  self.name == another.name
end

#each(&block) ⇒ Object



12
13
14
# File 'lib/algerb/file.rb', line 12

def each(&block)
  each_files(&block)
end