Class: Qa::Authorities::Base
- Inherits:
-
Object
- Object
- Qa::Authorities::Base
- Extended by:
- Deprecation
- Defined in:
- lib/qa/authorities/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#sub_authority ⇒ Object
Returns the value of attribute sub_authority.
Instance Method Summary collapse
-
#all ⇒ Object
By default, #all is not implemented.
-
#find(id) ⇒ Object
By default, #find is not implemented.
- #full_record(id, sub_authority = nil) ⇒ Object
-
#initialize(*args) ⇒ Base
constructor
Registers the authority and its sub-authority if it has one.
-
#sub_authorities ⇒ Object
By default, an authority has no subauthorities unless they are defined by the subclassed authority.
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 .include?(args.first) end end |
Instance Attribute Details
#sub_authority ⇒ Object
Returns the value of attribute sub_authority.
7 8 9 |
# File 'lib/qa/authorities/base.rb', line 7 def @sub_authority end |
Instance Method Details
#all ⇒ Object
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, =nil Deprecation.warn(".full_record is deprecated. Use .find instead") find(id) end |
#sub_authorities ⇒ Object
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 [] end |