Module: Qa::Authorities::AuthorityWithSubAuthority
- Included in:
- AssignFast, Getty, Loc, Local, Oclcts
- Defined in:
- lib/qa/authorities/authority_with_sub_authority.rb
Instance Method Summary collapse
- #new(subauthority = nil) ⇒ Object
-
#subauthorities ⇒ Object
By default, an authority has no subauthorities unless they are defined by the subclassed authority.
- #subauthority_class(name) ⇒ Object
- #subauthority_for(subauthority) ⇒ Object
- #validate_subauthority!(subauthority) ⇒ Object
Instance Method Details
#new(subauthority = nil) ⇒ Object
4 5 6 |
# File 'lib/qa/authorities/authority_with_sub_authority.rb', line 4 def new(=nil) raise "Initializing with as sub authority is removed. use #{self.class}.subauthority_for(#{.inspect}) instead" end |
#subauthorities ⇒ Object
By default, an authority has no subauthorities unless they are defined by the subclassed authority.
23 24 25 |
# File 'lib/qa/authorities/authority_with_sub_authority.rb', line 23 def [] end |
#subauthority_class(name) ⇒ Object
13 14 15 |
# File 'lib/qa/authorities/authority_with_sub_authority.rb', line 13 def (name) [self, name].join('::').classify.constantize end |
#subauthority_for(subauthority) ⇒ Object
8 9 10 11 |
# File 'lib/qa/authorities/authority_with_sub_authority.rb', line 8 def () () ().new end |
#validate_subauthority!(subauthority) ⇒ Object
17 18 19 |
# File 'lib/qa/authorities/authority_with_sub_authority.rb', line 17 def () raise Qa::InvalidSubAuthority, "Unable to initialize sub-authority #{} for #{self}. Valid sub-authorities are #{.inspect}" unless .include?() end |