Class: Snipcheat::SnippetDir
- Inherits:
-
Object
- Object
- Snipcheat::SnippetDir
- Defined in:
- lib/snipcheat/snippet_dir.rb
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #filenames ⇒ Object
-
#initialize(path) ⇒ SnippetDir
constructor
A new instance of SnippetDir.
- #snippets ⇒ Object
Constructor Details
#initialize(path) ⇒ SnippetDir
Returns a new instance of SnippetDir.
5 6 7 |
# File 'lib/snipcheat/snippet_dir.rb', line 5 def initialize(path) @path = path end |
Instance Method Details
#empty? ⇒ Boolean
9 10 11 |
# File 'lib/snipcheat/snippet_dir.rb', line 9 def empty? filenames.empty? end |
#filenames ⇒ Object
17 18 19 20 21 |
# File 'lib/snipcheat/snippet_dir.rb', line 17 def filenames @_filenames ||= Dir.new(@path).select{ |x| x.end_with? '.sublime-snippet' }.compact end |