Sha256: b1b5ef34483d17de44ee0c3c60e2021655fb4a4bbfe3b47328ad2274a1a9a656

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 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\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.7 lib/parameters/class_param.rb