Class: Bits::Provider
- Inherits:
-
Object
- Object
- Bits::Provider
- Defined in:
- lib/bits/provider.rb
Instance Attribute Summary collapse
-
#ns ⇒ Object
readonly
Returns the value of attribute ns.
Class Method Summary collapse
-
.check ⇒ Object
Override to provide custom static initialization code for provider.
Instance Method Summary collapse
- #execute(&block) ⇒ Object
-
#initialize(ns) ⇒ Provider
constructor
A new instance of Provider.
- #install(atom) ⇒ Object
- #query(atom) ⇒ Object
- #remove(atom) ⇒ Object
- #setup ⇒ Object
- #sync ⇒ Object
Constructor Details
#initialize(ns) ⇒ Provider
Returns a new instance of Provider.
15 16 17 |
# File 'lib/bits/provider.rb', line 15 def initialize(ns) @ns = ns end |
Instance Attribute Details
#ns ⇒ Object (readonly)
Returns the value of attribute ns.
13 14 15 |
# File 'lib/bits/provider.rb', line 13 def ns @ns end |
Class Method Details
.check ⇒ Object
Override to provide custom static initialization code for provider. Should return true if the specified provider can be used in this system.
8 9 10 |
# File 'lib/bits/provider.rb', line 8 def check true end |
Instance Method Details
#execute(&block) ⇒ Object
39 40 41 42 43 |
# File 'lib/bits/provider.rb', line 39 def execute(&block) raise "Missing user from namespace" if ns[:user].nil? context = ExecuteContext.new ns[:user] return context.instance_eval(&block) end |
#install(atom) ⇒ Object
31 32 33 |
# File 'lib/bits/provider.rb', line 31 def install(atom) raise "not implemented: install" end |
#query(atom) ⇒ Object
27 28 29 |
# File 'lib/bits/provider.rb', line 27 def query(atom) raise "not implemented: query" end |
#remove(atom) ⇒ Object
35 36 37 |
# File 'lib/bits/provider.rb', line 35 def remove(atom) raise "not implemented: remove" end |
#setup ⇒ Object
19 20 21 |
# File 'lib/bits/provider.rb', line 19 def setup raise "not implemented: setup" end |
#sync ⇒ Object
23 24 25 |
# File 'lib/bits/provider.rb', line 23 def sync raise "not implemented: sync" end |