Module: Wurfl::Utils

Included in:
Command::Comparator, Command::Inspector, Command::Loader, Command::Uamatch
Defined in:
lib/wurfl/utils.rb

Overview

A simple module to hold commonly used methods for the WURFL. This is currently just loading and saving a WURFL PStore database.

Instance Method Summary collapse

Instance Method Details

#load_wurfl_pstore(pstorefile) ⇒ Object

Does not catch exception, but throws to the caller.



12
13
14
# File 'lib/wurfl/utils.rb', line 12

def load_wurfl_pstore(pstorefile)
  PStore.new(pstorefile).transaction {|ps| ps["handsets"]}
end

#save_wurfl_pstore(pstorefile, handsets) ⇒ Object

Also throws exceptions to the caller.



17
18
19
# File 'lib/wurfl/utils.rb', line 17

def save_wurfl_pstore(pstorefile,handsets)
  PStore.new(pstorefile).transaction {|ps| ps["handsets"] = handsets}
end