Class: Ask::Tool::Parameter
- Inherits:
-
Object
- Object
- Ask::Tool::Parameter
- Defined in:
- lib/ask/tools/tool.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#required ⇒ Object
(also: #required?)
readonly
Returns the value of attribute required.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name:, type:, description: nil, required: true) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, type:, description: nil, required: true) ⇒ Parameter
Returns a new instance of Parameter.
230 231 232 |
# File 'lib/ask/tools/tool.rb', line 230 def initialize(name:, type:, description: nil, required: true) @name = name; @type = type; @description = description; @required = required end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
228 229 230 |
# File 'lib/ask/tools/tool.rb', line 228 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
228 229 230 |
# File 'lib/ask/tools/tool.rb', line 228 def name @name end |
#required ⇒ Object (readonly) Also known as: required?
Returns the value of attribute required.
228 229 230 |
# File 'lib/ask/tools/tool.rb', line 228 def required @required end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
228 229 230 |
# File 'lib/ask/tools/tool.rb', line 228 def type @type end |
Instance Method Details
#to_h ⇒ Object
233 234 235 |
# File 'lib/ask/tools/tool.rb', line 233 def to_h { name: name, type: type, description: description, required: required } end |