lib/ronin/author.rb in ronin-0.2.4 vs lib/ronin/author.rb in ronin-0.3.0
- old
+ new
@@ -1,9 +1,7 @@
#
-#--
-# Ronin - A Ruby platform designed for information security and data
-# exploration tasks.
+# Ronin - A Ruby platform for exploit development and security research.
#
# Copyright (c) 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,11 +14,10 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#++
#
require 'ronin/model'
require 'rexml/document'
@@ -30,11 +27,11 @@
class Author
include Model
# Anonymouse author name
- ANONYMOUSE = 'anonymous'
+ ANONYMOUSE = 'Anonymous'
# Primary key of the author
property :id, Serial
# Name of author
@@ -57,32 +54,44 @@
#
# Creates a new Author object with the given _options_. If _block_ is
# given, it will be passed the newly created Author object.
#
- # _info_ may contain the following keys:
- # <tt>:name</tt>:: The name of the author. Defaults to +ANONYMOUSE+.
- # <tt>:organization</tt>:: The organization of the author.
- # <tt>:pgp_signature</tt>:: The PGP signature of the author.
- # <tt>:email</tt>:: The email address of the author.
- # <tt>:url</tt>:: The URL for the author.
- # <tt>:biography</tt>:: The biography of the author.
+ # @param [Hash] options
+ # Additional options.
#
+ # @option options [String] :name (ANONYMOUSE)
+ # The name of the author.
+ #
+ # @option options [String] :organization
+ # The organization the author belongs to.
+ #
+ # @option options [String] :pgp_signature
+ # The PGP fingerprint of the author.
+ #
+ # @option options [String] :email
+ # The email to contact the author.
+ #
+ # @option options [String] :url
+ # The URL of the author.
+ #
+ # @option options [String] :biography
+ # The biography of the author.
+ #
def initialize(options={},&block)
super(options)
block.call(self) if block
end
- def name
- @name || ANONYMOUSE
- end
-
#
- # Returns the name of the author.
+ # Converts the author to a String.
#
+ # @return [String]
+ # The name of the author.
+ #
def to_s
- @name.to_s
+ self.name.to_s
end
end
end