Sha256: e6829cccde4936486fa4b9557426bf0573b54bc131b9fcb85e9480a23c626164

Contents?: true

Size: 715 Bytes

Versions: 5

Compression:

Stored size: 715 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.inspect}]" 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

5 entries across 5 versions & 1 rubygems

Version Path
parameters-0.1.4 lib/parameters/class_param.rb
parameters-0.1.5 lib/parameters/class_param.rb
parameters-0.1.2 lib/parameters/class_param.rb
parameters-0.1.3 lib/parameters/class_param.rb
parameters-0.1.6 lib/parameters/class_param.rb