Class: Atompub::ServiceInfoStorage
- Inherits:
-
Object
- Object
- Atompub::ServiceInfoStorage
- Defined in:
- lib/atomutil.rb
Constant Summary collapse
- @@singleton =
nil
Class Method Summary collapse
Instance Method Summary collapse
- #get(uri) ⇒ Object
-
#initialize ⇒ ServiceInfoStorage
constructor
A new instance of ServiceInfoStorage.
- #put(uri, collection, client = nil) ⇒ Object
Constructor Details
#initialize ⇒ ServiceInfoStorage
Returns a new instance of ServiceInfoStorage.
1251 1252 1253 |
# File 'lib/atomutil.rb', line 1251 def initialize @info = Hash.new end |
Class Method Details
.instance ⇒ Object
1246 1247 1248 1249 |
# File 'lib/atomutil.rb', line 1246 def self.instance @@singleton = self.new if @@singleton.nil? @@singleton end |
Instance Method Details
#get(uri) ⇒ Object
1255 1256 1257 |
# File 'lib/atomutil.rb', line 1255 def get(uri) @info.has_key?(uri) ? @info[uri] : nil end |
#put(uri, collection, client = nil) ⇒ Object
1259 1260 1261 1262 |
# File 'lib/atomutil.rb', line 1259 def put(uri, collection, client=nil) new_collection = clone_collection(collection, client) @info[uri] = ServiceInfo.new(:collection => new_collection) end |