Class: SanUltari::CommandParameter

Inherits:
Object
  • Object
show all
Defined in:
lib/sanultari/command_parameter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = nil) ⇒ CommandParameter

Returns a new instance of CommandParameter.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/sanultari/command_parameter.rb', line 4

def initialize name, options = nil
  if options
    @default = options[:default]
    @type = options[:type]
    @type ||= :accessor
    @require = options[:require]
    @require ||= true
    if @type == :parameter
      @order = options[:order]
      @order ||= -1
    end
  end
  @name = name
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



2
3
4
# File 'lib/sanultari/command_parameter.rb', line 2

def default
  @default
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/sanultari/command_parameter.rb', line 2

def name
  @name
end

#orderObject (readonly)

Returns the value of attribute order.



2
3
4
# File 'lib/sanultari/command_parameter.rb', line 2

def order
  @order
end

#typeObject (readonly)

Returns the value of attribute type.



2
3
4
# File 'lib/sanultari/command_parameter.rb', line 2

def type
  @type
end

Instance Method Details

#require?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/sanultari/command_parameter.rb', line 19

def require?
  @require
end