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.
186 187 188 |
# File 'lib/ask/tools/tool.rb', line 186 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.
184 185 186 |
# File 'lib/ask/tools/tool.rb', line 184 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
184 185 186 |
# File 'lib/ask/tools/tool.rb', line 184 def name @name end |
#required ⇒ Object (readonly) Also known as: required?
Returns the value of attribute required.
184 185 186 |
# File 'lib/ask/tools/tool.rb', line 184 def required @required end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
184 185 186 |
# File 'lib/ask/tools/tool.rb', line 184 def type @type end |
Instance Method Details
#to_h ⇒ Object
189 190 191 |
# File 'lib/ask/tools/tool.rb', line 189 def to_h { name: name, type: type, description: description, required: required } end |