Module: Conflow::Redis::Findable

Included in:
Flow
Defined in:
lib/conflow/redis/findable.rb

Overview

Findable module allows to use .find method on models with identifiers. It requires additional field: :type

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
# File 'lib/conflow/redis/findable.rb', line 7

def self.included(base)
  base.extend ClassMethods
  base.field :type, :value
end

Instance Method Details

#initialize(*args) ⇒ Object



12
13
14
15
# File 'lib/conflow/redis/findable.rb', line 12

def initialize(*args)
  super
  self.type = self.class.name
end