Class: EY::Pairing::Author
- Inherits:
-
Struct
- Object
- Struct
- EY::Pairing::Author
- Defined in:
- lib/ey_pairing/author.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#init ⇒ Object
Returns the value of attribute init.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Author
constructor
A new instance of Author.
Constructor Details
#initialize(*args) ⇒ Author
Returns a new instance of Author.
15 16 17 18 19 |
# File 'lib/ey_pairing/author.rb', line 15 def initialize(*args) super self.init ||= name && name.scan(/(?:^|\s)(\w)/).flatten.join.downcase self.class.register self end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email
5 6 7 |
# File 'lib/ey_pairing/author.rb', line 5 def email @email end |
#init ⇒ Object
Returns the value of attribute init
5 6 7 |
# File 'lib/ey_pairing/author.rb', line 5 def init @init end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/ey_pairing/author.rb', line 5 def name @name end |
Class Method Details
.all ⇒ Object
6 7 8 |
# File 'lib/ey_pairing/author.rb', line 6 def self.all (@all || []).sort_by { || .init } end |
.register(author) ⇒ Object
10 11 12 13 |
# File 'lib/ey_pairing/author.rb', line 10 def self.register() @all ||= [] @all << end |