Class: Warped::Filter::String

Inherits:
Base
  • Object
show all
Defined in:
lib/warped/api/filter/string.rb

Constant Summary collapse

RELATIONS =
Queries::Filter::RELATIONS

Instance Attribute Summary

Attributes inherited from Base

#alias_name, #name, #options, #strict

Instance Method Summary collapse

Methods inherited from Base

#initialize, kind, #kind, #parameter_name, #relation, #relations

Constructor Details

This class inherits a constructor from Warped::Filter::Base

Instance Method Details

#cast(value) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/warped/api/filter/string.rb', line 10

def cast(value)
  return if value.blank?

  value.to_s
rescue StandardError
  raise ValueError, "#{value} cannot be casted to #{kind}" if strict

  nil
end

#html_typeObject



20
21
22
# File 'lib/warped/api/filter/string.rb', line 20

def html_type
  "text"
end