Class: CodeModels::Language

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Language

Returns a new instance of Language.



38
39
40
41
# File 'lib/codemodels/language.rb', line 38

def initialize(name)
	@name = name
	@extensions = []
end

Instance Attribute Details

#extensionsObject (readonly)

Returns the value of attribute extensions.



35
36
37
# File 'lib/codemodels/language.rb', line 35

def extensions
  @extensions
end

#nameObject (readonly)

Returns the value of attribute name.



34
35
36
# File 'lib/codemodels/language.rb', line 34

def name
  @name
end

#parserObject (readonly)

Returns the value of attribute parser.



36
37
38
# File 'lib/codemodels/language.rb', line 36

def parser
  @parser
end

Instance Method Details

#can_parse?(path) ⇒ Boolean

Returns:



43
44
45
46
47
# File 'lib/codemodels/language.rb', line 43

def can_parse?(path)
	extension = File.extname(path)
	extension=extension[1..-1] if extension.length>0		
	@extensions.include?(extension)
end