Class: IOSBox::Cache
- Inherits:
-
Object
- Object
- IOSBox::Cache
- Defined in:
- lib/ios-box/iosbox.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
Class Method Summary collapse
Instance Method Summary collapse
- #[](v) ⇒ Object
- #[]=(v, s) ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #save(file = ".buildcache") ⇒ Object
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
226 227 228 |
# File 'lib/ios-box/iosbox.rb', line 226 def initialize @cache = {} end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
214 215 216 |
# File 'lib/ios-box/iosbox.rb', line 214 def cache @cache end |
Class Method Details
Instance Method Details
#[](v) ⇒ Object
230 231 232 |
# File 'lib/ios-box/iosbox.rb', line 230 def [](v) @cache[v] end |
#[]=(v, s) ⇒ Object
234 235 236 |
# File 'lib/ios-box/iosbox.rb', line 234 def []=(v, s) @cache[v] = s end |
#save(file = ".buildcache") ⇒ Object
238 239 240 |
# File 'lib/ios-box/iosbox.rb', line 238 def save(file = ".buildcache") File.open(file, 'w') { |io| io.puts @cache.to_yaml } end |