Class: MemDB::Field::Enum
- Inherits:
-
Object
- Object
- MemDB::Field::Enum
- Includes:
- MemDB::Field
- Defined in:
- lib/mem_db/field/enum.rb
Defined Under Namespace
Classes: MultiMatching, SingleMatching
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
-
#initialize(field) ⇒ Enum
constructor
A new instance of Enum.
- #new_matching(value) ⇒ Object
Methods included from MemDB::Field
#downcase, #field_value, #may_missing, #negative, #prepare_query, #query, #query_field
Constructor Details
#initialize(field) ⇒ Enum
Returns a new instance of Enum.
37 38 39 |
# File 'lib/mem_db/field/enum.rb', line 37 def initialize(field) @field = field end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
35 36 37 |
# File 'lib/mem_db/field/enum.rb', line 35 def field @field end |
Instance Method Details
#new_matching(value) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/mem_db/field/enum.rb', line 41 def new_matching(value) if value.is_a?(Array) MultiMatching.new(value) else SingleMatching.new(value) end end |