Class: Bits::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/bits/provider.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#nsObject (readonly)

Returns the value of attribute ns.



13
14
15
# File 'lib/bits/provider.rb', line 13

def ns
  @ns
end

Class Method Details

.checkObject

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

#setupObject



19
20
21
# File 'lib/bits/provider.rb', line 19

def setup
  raise "not implemented: setup"
end

#syncObject



23
24
25
# File 'lib/bits/provider.rb', line 23

def sync
  raise "not implemented: sync"
end