Class: ActionMCP::StringArray
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- ActionMCP::StringArray
- Defined in:
- lib/action_mcp/string_array.rb
Overview
Custom type for handling arrays of strings in ActiveModel.
Instance Method Summary collapse
-
#cast(value) ⇒ Array<String>
Casts the given value to an array of strings.
Instance Method Details
#cast(value) ⇒ Array<String>
Casts the given value to an array of strings.
10 11 12 |
# File 'lib/action_mcp/string_array.rb', line 10 def cast(value) Array(value).map(&:to_s) # Ensure all elements are strings end |