class Grit::Actor
Attributes
email[R]
name[R]
to_s[R]
Public Class Methods
from_string(str)
click to toggle source
Create an Actor
from a string.
+str+ is the string, which is expected to be in regular git format
Format
John Doe <jdoe@example.com>
Returns Actor
# File lib/grit/lib/grit/actor.rb, line 20 def self.from_string(str) case str when /<.+>/ m, name, email = *str.match(/(.*) <(.+?)>/) return self.new(name, email) else return self.new(str, nil) end end
new(name, email)
click to toggle source
# File lib/grit/lib/grit/actor.rb, line 7 def initialize(name, email) @name = name @email = email end
Public Instance Methods
inspect()
click to toggle source
Pretty object inspection
# File lib/grit/lib/grit/actor.rb, line 31 def inspect %Q{#<Grit::Actor "#{@name} <#{@email}>">} end