Class: WellReadFaker::Source
- Inherits:
-
Object
- Object
- WellReadFaker::Source
- Includes:
- Mutex_m
- Defined in:
- lib/well_read_faker/source.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path_to_book_or_io ⇒ Object
readonly
Returns the value of attribute path_to_book_or_io.
Instance Method Summary collapse
- #ensure_loaded ⇒ Object
-
#initialize(path_to_book_or_io, options = {}) ⇒ Source
constructor
A new instance of Source.
- #paragraph ⇒ Object
Constructor Details
#initialize(path_to_book_or_io, options = {}) ⇒ Source
Returns a new instance of Source.
9 10 11 12 13 |
# File 'lib/well_read_faker/source.rb', line 9 def initialize path_to_book_or_io, = {} super() @path_to_book_or_io = path_to_book_or_io @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/well_read_faker/source.rb', line 7 def @options end |
#path_to_book_or_io ⇒ Object (readonly)
Returns the value of attribute path_to_book_or_io.
7 8 9 |
# File 'lib/well_read_faker/source.rb', line 7 def path_to_book_or_io @path_to_book_or_io end |
Instance Method Details
#ensure_loaded ⇒ Object
20 21 22 |
# File 'lib/well_read_faker/source.rb', line 20 def ensure_loaded @loaded or mu_synchronize{ @loaded or load } end |
#paragraph ⇒ Object
15 16 17 18 |
# File 'lib/well_read_faker/source.rb', line 15 def paragraph ensure_loaded @paragraphs_arr[inc_paragraphs] end |