Class: Tanuki::Argument::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/tanuki/argument/base.rb

Overview

Tanuki::Argument::Base is the base class for argument types.

Direct Known Subclasses

Integer, String

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default) ⇒ Base

Initializes the argument with a default value.



10
11
12
# File 'lib/tanuki/argument/base.rb', line 10

def initialize(default)
  @value = @default = default
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



7
8
9
# File 'lib/tanuki/argument/base.rb', line 7

def default
  @default
end

#valueObject

Returns the value of attribute value.



7
8
9
# File 'lib/tanuki/argument/base.rb', line 7

def value
  @value
end

Instance Method Details

#to_sObject

Returns a string representation of the argument value.



15
16
17
# File 'lib/tanuki/argument/base.rb', line 15

def to_s
  @value.to_s
end