Class: Legalizer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/legalizer/base.rb

Direct Known Subclasses

Document, Find

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



3
4
5
6
7
8
9
10
11
# File 'lib/legalizer/base.rb', line 3

def initialize(options={})
  if options[:config].is_a? Legalizer::Config
    @config = options[:config]
    @connection = options[:config].connection
    @token = options[:config].token
  else
    @config = Legalizer::Config.new(options)
  end
end

Instance Method Details

#configObject



21
22
23
# File 'lib/legalizer/base.rb', line 21

def config
  @config
end

#connectionObject



13
14
15
# File 'lib/legalizer/base.rb', line 13

def connection
  @config.connection
end

#contractsObject



29
30
31
# File 'lib/legalizer/base.rb', line 29

def contracts
  Legalizer::Contract.new({:config => @config})
end

#findObject



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

def find
  Legalizer::Find.new({:config => @config})
end

#templatesObject



25
26
27
# File 'lib/legalizer/base.rb', line 25

def templates
  Legalizer::Template.new({:config => @config})
end

#tokenObject



17
18
19
# File 'lib/legalizer/base.rb', line 17

def token
  @config.token
end