Class: Gem::Author
- Inherits:
-
Struct
- Object
- Struct
- Gem::Author
- Defined in:
- lib/rubygems/author.rb,
lib/rubygems/author/version.rb
Overview
# Gem Author
This class holds authors info to be used primarily in gem specs.
## Usage
-
Inherit
Gem::Authorinside your gem and add the authors’ info.
Example:
module MyLib
class Author < Gem::Author
new(
name: 'Your Name',
email: 'Your.Name@email.service',
github: 'Your-GitHub-Username',
)
end
end
-
You can call some helper methods now.
Example:
Gem::Specification.new do |spec|
spec.name = 'my_lib'
spec.version = MyLib::VERSION
spec. = MyLib::Author.names
spec.email = MyLib::Author.emails
spec.homepage = "#{MyLib::Author.github_url}/#{spec.name}"
end
Direct Known Subclasses
Defined Under Namespace
Modules: ClassMethods Classes: Author
Constant Summary collapse
- VERSION =
'0.1.2'
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#github ⇒ Object
Returns the value of attribute github.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email
36 37 38 |
# File 'lib/rubygems/author.rb', line 36 def email @email end |
#github ⇒ Object
Returns the value of attribute github
36 37 38 |
# File 'lib/rubygems/author.rb', line 36 def github @github end |
#name ⇒ Object
Returns the value of attribute name
36 37 38 |
# File 'lib/rubygems/author.rb', line 36 def name @name end |
Class Method Details
.inherited(child) ⇒ Object
41 42 43 44 45 |
# File 'lib/rubygems/author.rb', line 41 def self.inherited child super child.extend ClassMethods end |
Instance Method Details
#github_url ⇒ Object
55 |
# File 'lib/rubygems/author.rb', line 55 def github_url = github && "https://github.com/#{github}" |