Class: Qa::Authorities::Base

Inherits:
Object
  • Object
show all
Extended by:
Deprecation
Defined in:
lib/qa/authorities/base.rb

Direct Known Subclasses

Local, Mesh, Tgnlang, WebServiceBase

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Base

Registers the authority and its sub-authority if it has one



10
11
12
13
14
# File 'lib/qa/authorities/base.rb', line 10

def initialize *args
  if args.first
    raise "Invalid sub-authority" unless sub_authorities.include?(args.first)
  end
end

Instance Attribute Details

#sub_authorityObject

Returns the value of attribute sub_authority.



7
8
9
# File 'lib/qa/authorities/base.rb', line 7

def sub_authority
  @sub_authority
end

Instance Method Details

#allObject

By default, #all is not implemented. If the subclassed authority does have this feature then you will overide the #all method in the subclassed authority. TODO: need to set some kind of error here



26
27
# File 'lib/qa/authorities/base.rb', line 26

def all
end

#find(id) ⇒ Object

By default, #find is not implemented. If the subclassed authority does have this feature then you will overide the #find method in the subclassed authority. TODO: need to set some kind of error here



33
34
# File 'lib/qa/authorities/base.rb', line 33

def find id
end

#full_record(id, sub_authority = nil) ⇒ Object



36
37
38
39
# File 'lib/qa/authorities/base.rb', line 36

def full_record id, sub_authority=nil
  Deprecation.warn(".full_record is deprecated. Use .find instead")
  find(id)
end

#sub_authoritiesObject

By default, an authority has no subauthorities unless they are defined by the subclassed authority.



18
19
20
# File 'lib/qa/authorities/base.rb', line 18

def sub_authorities
  []
end