Class: GitMeta::Scanner

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

Constant Summary collapse

REGEX =
/(\S+):\s*(.+)$/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Scanner

Returns a new instance of Scanner.



11
12
13
14
15
16
# File 'lib/git_meta.rb', line 11

def initialize(text)
  self.info = Hash.new("")
  text.scan(REGEX) do |k,v|
    self.info[k] = v
  end
end

Instance Attribute Details

#infoObject

Returns the value of attribute info.



7
8
9
# File 'lib/git_meta.rb', line 7

def info
  @info
end

Instance Method Details

#==(comrade) ⇒ Object



18
19
20
# File 'lib/git_meta.rb', line 18

def ==(comrade)
  info == comrade.info
end