Class: PMS

Inherits:
Object
  • Object
show all
Defined in:
lib/pms/proxy.rb,
lib/pms.rb,
lib/pms/i18n.rb,
lib/pms/index.rb,
lib/pms/version.rb

Overview

#

A component of pms, Poor Man’s Search. #

#

Copyright © 2008-2014 Jens Wille #

#

Authors: #

Jens Wille <jens.wille@gmail.com>                                       #
                                                                        #

pms is free software; you can redistribute it and/or modify it under the # terms of the GNU Affero General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your option) # any later version. #

#

pms is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for # more details. #

#

You should have received a copy of the GNU Affero General Public License # along with pms. If not, see <www.gnu.org/licenses/>. #

#

++

Defined Under Namespace

Modules: Ext, I18n, Version Classes: Index, Proxy, TokenProxy

Constant Summary collapse

VERSION =
Version.to_s

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, options = {}) ⇒ PMS

Returns a new instance of PMS.



35
36
37
38
# File 'lib/pms.rb', line 35

def initialize(input, options = {})
  @input = input
  @index = Index.new(input, options)
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



33
34
35
# File 'lib/pms.rb', line 33

def index
  @index
end

#inputObject (readonly)

Returns the value of attribute input.



33
34
35
# File 'lib/pms.rb', line 33

def input
  @input
end

Instance Method Details

#matchesObject



50
51
52
# File 'lib/pms.rb', line 50

def matches
  @index.matches
end

#resultsObject



46
47
48
# File 'lib/pms.rb', line 46

def results
  @index.entries
end

#search(token = nil, &block) ⇒ Object Also known as: /



40
41
42
# File 'lib/pms.rb', line 40

def search(token = nil, &block)
  token ? TokenProxy.new(self, token) : Proxy.new(self).and(&block)
end