Class: GitObjectBrowser::Models::Reflog
- Inherits:
-
Object
- Object
- GitObjectBrowser::Models::Reflog
- Defined in:
- lib/git-object-browser/models/reflog.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(input) ⇒ Reflog
constructor
A new instance of Reflog.
- #parse ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(input) ⇒ Reflog
Returns a new instance of Reflog.
7 8 9 |
# File 'lib/git-object-browser/models/reflog.rb', line 7 def initialize(input) @in = input end |
Class Method Details
.path?(relpath) ⇒ Boolean
48 49 50 |
# File 'lib/git-object-browser/models/reflog.rb', line 48 def self.path?(relpath) return relpath =~ %r{\Alogs/.+} end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/git-object-browser/models/reflog.rb', line 11 def parse @entries = [] @content = @in.read(nil) @content = @content.force_encoding('UTF-8') unless @content.valid_encoding? @content = '(not UTF-8)' return self end parse_logs self end |
#to_hash ⇒ Object
44 45 46 |
# File 'lib/git-object-browser/models/reflog.rb', line 44 def to_hash return { :content => @content, :entries => @entries } end |