Class: FunctionObject::ArgumentsBuilder::Descriptor

Inherits:
Struct
  • Object
show all
Defined in:
lib/function_object/arguments_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDescriptor

Returns a new instance of Descriptor.



3
4
5
6
7
8
# File 'lib/function_object/arguments_builder.rb', line 3

def initialize(*)
  super
  if default? && !self.default.respond_to?(:call)
    fail ArgumentError, "#{self.default.inspect} is expected to be callable"
  end
end

Instance Attribute Details

#defaultObject

Returns the value of attribute default

Returns:

  • (Object)

    the current value of default



2
3
4
# File 'lib/function_object/arguments_builder.rb', line 2

def default
  @default
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/function_object/arguments_builder.rb', line 2

def name
  @name
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



2
3
4
# File 'lib/function_object/arguments_builder.rb', line 2

def options
  @options
end

Instance Method Details

#default?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/function_object/arguments_builder.rb', line 10

def default?
  options.key? :default
end