Sha256: a67faa464378ab1f7a2c8eff0773737c096c5a8d6bb4b0e1f003eb20e6af6b80

Contents?: true

Size: 707 Bytes

Versions: 1

Compression:

Stored size: 707 Bytes

Contents

require 'parameters/param'

module Parameters
  class ClassParam < Param

    # Default value of the class parameter
    attr_accessor :value

    #
    # Creates a new ClassParam object with the specified _name_,
    # given _description_ and _value_.
    #
    def initialize(name,description=nil,value=nil)
      super(name,description)

      @value = value
    end

    #
    # Returns the String representation of the class param.
    #
    def to_s
      text = "  #{@name}"

      text << " [#{@value}]" if @value
      text << "\t#{@description}" if @description

      return text
    end

    #
    # Inspects the class params value.
    #
    def inspect
      @value.inspect
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parameters-0.1.1 lib/parameters/class_param.rb