Class: ActionMCP::IntegerArray
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- ActionMCP::IntegerArray
- Defined in:
- lib/action_mcp/integer_array.rb
Overview
This temporary naming extracted from MCPangea If there is a better name, please suggest it or part of ActiveModel, open a PR
Custom type for handling arrays of integers in ActiveModel.
Instance Method Summary collapse
-
#cast(value) ⇒ Array<Integer>
Casts the given value to an array of integers.
Instance Method Details
#cast(value) ⇒ Array<Integer>
Casts the given value to an array of integers.
13 14 15 |
# File 'lib/action_mcp/integer_array.rb', line 13 def cast(value) Array(value).map(&:to_i) # Ensure all elements are integers end |