Class: GistGenerator::File

Inherits:
Object
  • Object
show all
Defined in:
lib/gist_generator/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo_path, file_path, options) ⇒ File

Returns a new instance of File.



6
7
8
9
10
# File 'lib/gist_generator/file.rb', line 6

def initialize(repo_path, file_path, options)
  @repo_path = repo_path
  @file_path = file_path
  @options = options
end

Instance Method Details

#linesObject



12
13
14
# File 'lib/gist_generator/file.rb', line 12

def lines
  @lines ||= Faraday.get(content.download_url).body.lines
end

#number_of_linesObject



16
17
18
# File 'lib/gist_generator/file.rb', line 16

def number_of_lines
  lines.length
end