Class: SearchCopGrammar::Attributes::Float
- Inherits:
-
WithoutMatches
- Object
- Base
- WithoutMatches
- SearchCopGrammar::Attributes::Float
- Defined in:
- lib/search_cop_grammar/attributes.rb
Instance Attribute Summary
Attributes inherited from Base
#attribute, #column_name, #field_names, #options, #table_alias
Instance Method Summary collapse
Methods inherited from WithoutMatches
Methods inherited from Base
#fulltext?, #initialize, #method_missing, #respond_to_missing?
Constructor Details
This class inherits a constructor from SearchCopGrammar::Attributes::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SearchCopGrammar::Attributes::Base
Instance Method Details
#compatible?(value) ⇒ Boolean
195 196 197 198 199 |
# File 'lib/search_cop_grammar/attributes.rb', line 195 def compatible?(value) return true if value.to_s =~ /^-?[0-9]+(\.[0-9]+)?$/ false end |
#map(value) ⇒ Object
201 202 203 |
# File 'lib/search_cop_grammar/attributes.rb', line 201 def map(value) value.to_f end |