lib/parameters/class_param.rb in parameters-0.1.7 vs lib/parameters/class_param.rb in parameters-0.1.8
- old
+ new
@@ -5,32 +5,42 @@
# Default value of the class parameter
attr_accessor :value
#
- # Creates a new ClassParam object with the specified _name_,
- # given _description_ and _value_.
+ # Creates a new ClassParam object.
#
+ # @param [Symbol, String] name
+ # The name of the class parameter.
+ #
+ # @param [String, nil] description
+ # The description of the class parameter.
+ #
+ # @param [Object, nil] value
+ # The default value of the class parameter.
+ #
def initialize(name,description=nil,value=nil)
super(name,description)
@value = value
end
#
- # Returns the String representation of the class param.
+ # @return [String]
+ # The representation of the class param.
#
def to_s
- text = " #{@name}"
+ text = @name.to_s
text << " [#{@value.inspect}]" if @value
- text << "\t\t#{@description}" if @description
+ text << "\t#{@description}" if @description
return text
end
#
- # Inspects the class params value.
+ # @return [String]
+ # Inspection of the class params value.
#
def inspect
@value.inspect
end