Class: JpStringsFinder::FiletypeDetector
- Inherits:
-
Object
- Object
- JpStringsFinder::FiletypeDetector
- Defined in:
- lib/jp_strings_finder/filetype_detector.rb
Instance Attribute Summary collapse
-
#filetype ⇒ Object
readonly
Returns the value of attribute filetype.
Instance Method Summary collapse
-
#initialize(file_path) ⇒ FiletypeDetector
constructor
A new instance of FiletypeDetector.
Constructor Details
#initialize(file_path) ⇒ FiletypeDetector
Returns a new instance of FiletypeDetector.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/jp_strings_finder/filetype_detector.rb', line 5 def initialize(file_path) @filetype = case File.extname(file_path) when ".rb" :ruby when ".erb" :erb when ".slim" :slim else raise "Unsupported filetype [#{file_path}]" end end |
Instance Attribute Details
#filetype ⇒ Object (readonly)
Returns the value of attribute filetype.
3 4 5 |
# File 'lib/jp_strings_finder/filetype_detector.rb', line 3 def filetype @filetype end |