class GitObjectBrowser::Models::PlainFile
Public Class Methods
new(input)
click to toggle source
# File lib/git-object-browser/models/plain_file.rb, line 7 def initialize(input) @in = input end
Public Instance Methods
parse()
click to toggle source
# File lib/git-object-browser/models/plain_file.rb, line 11 def parse @content = @in.read(nil) @content = @content.force_encoding('UTF-8') @content = '(not UTF-8)' unless @content.valid_encoding? @content = @content[0, 3000] + "\n..." if @content.length > 3000 self end
to_hash()
click to toggle source
# File lib/git-object-browser/models/plain_file.rb, line 19 def to_hash return { :content => @content } end