Class: Toolchest::ToolBuilder
- Inherits:
-
Object
- Object
- Toolchest::ToolBuilder
- Defined in:
- lib/toolchest/tool_builder.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize ⇒ ToolBuilder
constructor
A new instance of ToolBuilder.
- #param(name, type, description = "", **options, &block) ⇒ Object
Constructor Details
#initialize ⇒ ToolBuilder
Returns a new instance of ToolBuilder.
5 |
# File 'lib/toolchest/tool_builder.rb', line 5 def initialize = @params = [] |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/toolchest/tool_builder.rb', line 3 def params @params end |
Instance Method Details
#param(name, type, description = "", **options, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/toolchest/tool_builder.rb', line 7 def param(name, type, description = "", **, &block) @params << ParamDefinition.new( name: name, type: type, description: description, optional: .fetch(:optional, false), enum: [:enum], default: .fetch(:default, :__unset__), &block ) end |