Class: Fui::Header

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

Overview

Represents a Header (.h) file

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Header

Returns a new instance of Header.



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

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.



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

def filename
  @filename
end

#filename_without_extensionObject

Returns the value of attribute filename_without_extension.



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

def filename_without_extension
  @filename_without_extension
end

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

Class Method Details

.header?(path) ⇒ Boolean

Returns:

  • (Boolean)


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

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