Class: Algerb::File
Constant Summary collapse
- FILE_PATTERN =
%r{/?(a-z0-9\-_\.)$}i
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(another) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(name) ⇒ File
constructor
A new instance of File.
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
#name ⇒ Object (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 |