Class: Legalizer::Document

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

Direct Known Subclasses

Contract, Template

Instance Method Summary collapse

Methods inherited from Base

#config, #connection, #contracts, #find, #templates, #token

Constructor Details

#initialize(options = {}) ⇒ Document

Returns a new instance of Document.



3
4
5
6
# File 'lib/legalizer/document.rb', line 3

def initialize(options={})
  super(options)
  @source = options[:object]
end

Instance Method Details

#idObject



12
13
14
# File 'lib/legalizer/document.rb', line 12

def id
  @source.documentKey
end

#sourceObject



8
9
10
# File 'lib/legalizer/document.rb', line 8

def source
  @source
end

#to_sObject



16
17
18
# File 'lib/legalizer/document.rb', line 16

def to_s
  @source.name
end

#to_structObject



20
21
22
# File 'lib/legalizer/document.rb', line 20

def to_struct
  OpenStruct.new @source
end