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

#as_json(options = nil) ⇒ Object



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

def as_json options = nil
  @hash
end

#idObject



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

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



17
18
19
# File 'lib/lunr/model.rb', line 17

def to_h
  @hash
end