Class: Unbelievable::Generator
- Inherits:
-
Object
- Object
- Unbelievable::Generator
- Defined in:
- lib/unbelievable/generator.rb
Constant Summary collapse
- @@dictionary =
{}
Instance Method Summary collapse
-
#initialize(style = default_style) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(style = default_style) ⇒ Generator
Returns a new instance of Generator.
12 13 14 15 |
# File 'lib/unbelievable/generator.rb', line 12 def initialize(style = default_style) file_name = "#{File.dirname(__FILE__)}/dictionary/#{style}.json" @@dictionary[style] ||= File.open(file_name) { |f| JSON.load(f) } end |