Class: Fib::Container
- Inherits:
-
Object
- Object
- Fib::Container
- Extended by:
- Forwardable
- Defined in:
- lib/fib/container.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#fpa ⇒ Object
Returns the value of attribute fpa.
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
-
#permissions ⇒ Object
Returns the value of attribute permissions.
Instance Method Summary collapse
- #build(&block) ⇒ Object
- #configure(&block) ⇒ Object
-
#initialize(key, name) ⇒ Container
constructor
A new instance of Container.
- #load_fpa ⇒ Object
- #loading! ⇒ Object
- #restore_permissions(redis_key) ⇒ Object
Constructor Details
#initialize(key, name) ⇒ Container
Returns a new instance of Container.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fib/container.rb', line 12 def initialize key, name @key = key @name = name @permissions = Fib::PermissionsCollection.new @config = Fib::Config.new @fpa = Fib::Fpa.new @permissions.container = self self.class.containers << self end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/fib/container.rb', line 5 def config @config end |
#fpa ⇒ Object
Returns the value of attribute fpa.
5 6 7 |
# File 'lib/fib/container.rb', line 5 def fpa @fpa end |
#key ⇒ Object
Returns the value of attribute key.
5 6 7 |
# File 'lib/fib/container.rb', line 5 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fib/container.rb', line 5 def name @name end |
#permissions ⇒ Object
Returns the value of attribute permissions.
5 6 7 |
# File 'lib/fib/container.rb', line 5 def @permissions end |
Instance Method Details
#build(&block) ⇒ Object
36 37 38 |
# File 'lib/fib/container.rb', line 36 def build &block .instance_exec &block end |
#configure(&block) ⇒ Object
23 24 25 26 |
# File 'lib/fib/container.rb', line 23 def configure &block config_configure &block loading! end |
#load_fpa ⇒ Object
32 33 34 |
# File 'lib/fib/container.rb', line 32 def load_fpa fpa.redis = config.redis end |
#loading! ⇒ Object
28 29 30 |
# File 'lib/fib/container.rb', line 28 def loading! load_fpa end |
#restore_permissions(redis_key) ⇒ Object
40 41 42 43 |
# File 'lib/fib/container.rb', line 40 def redis_key return unless keys = fpa.get(redis_key) .extract_by_keys keys end |