Module: Lunr::Model

Defined in:
lib/lunr/model.rb,
lib/lunr/model/klass.rb

Defined Under Namespace

Modules: Klass

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



6
7
8
# File 'lib/lunr/model/klass.rb', line 6

def self.included klass
  klass.extend Klass
end

Instance Method Details

#idObject



9
10
11
# File 'lib/lunr/model.rb', line 9

def id
  @hash[:id]
end

#initialize(hash) ⇒ Object



5
6
7
# File 'lib/lunr/model.rb', line 5

def initialize hash
  @hash = hash
end

#to_hObject



13
14
15
# File 'lib/lunr/model.rb', line 13

def to_h
  @hash
end