Class: Fui::Header

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Header

Returns a new instance of Header.



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

def initialize(path)
  @path = path
  @filename = File.basename(path)
  @filename_without_extension = File.basename(path, File.extname(path))
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



3
4
5
# File 'lib/fui/header.rb', line 3

def filename
  @filename
end

#filename_without_extensionObject

Returns the value of attribute filename_without_extension.



3
4
5
# File 'lib/fui/header.rb', line 3

def filename_without_extension
  @filename_without_extension
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/fui/header.rb', line 3

def path
  @path
end

Class Method Details

.header?(path) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.header?(path)
  File.extname(path) == '.h'
end