| Class | Grit::Actor |
| In: |
lib/grit/actor.rb
|
| Parent: | Object |
| name | -> | to_s |
| [R] | ||
| name | [R] |
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/actor.rb, line 20
20: def self.from_string(str)
21: case str
22: when /<.+>/
23: m, name, email = *str.match(/(.*) <(.+?)>/)
24: return self.new(name, email)
25: else
26: return self.new(str, nil)
27: end
28: end
# File lib/grit/actor.rb, line 7
7: def initialize(name, email)
8: @name = name
9: @email = email
10: end