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.
1254 1255 1256 |
# File 'lib/atomutil.rb', line 1254 def initialize @info = Hash.new end |
Class Method Details
.instance ⇒ Object
1249 1250 1251 1252 |
# File 'lib/atomutil.rb', line 1249 def self.instance @@singleton = self.new if @@singleton.nil? @@singleton end |
Instance Method Details
#get(uri) ⇒ Object
1258 1259 1260 |
# File 'lib/atomutil.rb', line 1258 def get(uri) @info.has_key?(uri) ? @info[uri] : nil end |
#put(uri, collection, client = nil) ⇒ Object
1262 1263 1264 1265 |
# File 'lib/atomutil.rb', line 1262 def put(uri, collection, client=nil) new_collection = clone_collection(collection, client) @info[uri] = ServiceInfo.new(:collection => new_collection) end |