Class: FunctionObject::ArgumentsBuilder::Descriptor
- Inherits:
-
Struct
- Object
- Struct
- FunctionObject::ArgumentsBuilder::Descriptor
- Defined in:
- lib/function_object/arguments_builder.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #default? ⇒ Boolean
-
#initialize ⇒ Descriptor
constructor
A new instance of Descriptor.
Constructor Details
#initialize ⇒ Descriptor
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
#default ⇒ Object
Returns the value of attribute default
2 3 4 |
# File 'lib/function_object/arguments_builder.rb', line 2 def default @default end |
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/function_object/arguments_builder.rb', line 2 def name @name end |
#options ⇒ Object
Returns the value of attribute options
2 3 4 |
# File 'lib/function_object/arguments_builder.rb', line 2 def end |
Instance Method Details
#default? ⇒ Boolean
10 11 12 |
# File 'lib/function_object/arguments_builder.rb', line 10 def default? .key? :default end |