Class: SdbDal::LazyLoadingText
- Inherits:
-
Object
- Object
- SdbDal::LazyLoadingText
- Defined in:
- lib/sdb_dal/lazy_loading_text.rb
Instance Attribute Summary collapse
-
#has_loaded ⇒ Object
readonly
Returns the value of attribute has_loaded.
-
#is_dirty ⇒ Object
readonly
Returns the value of attribute is_dirty.
Instance Method Summary collapse
-
#initialize(get_clob_proc) ⇒ LazyLoadingText
constructor
A new instance of LazyLoadingText.
- #value ⇒ Object
- #value=(v) ⇒ Object
Constructor Details
#initialize(get_clob_proc) ⇒ LazyLoadingText
Returns a new instance of LazyLoadingText.
9 10 11 12 13 |
# File 'lib/sdb_dal/lazy_loading_text.rb', line 9 def initialize(get_clob_proc) @get_clob_proc=get_clob_proc @has_loaded=false @is_dirty=false end |
Instance Attribute Details
#has_loaded ⇒ Object (readonly)
Returns the value of attribute has_loaded.
8 9 10 |
# File 'lib/sdb_dal/lazy_loading_text.rb', line 8 def has_loaded @has_loaded end |
#is_dirty ⇒ Object (readonly)
Returns the value of attribute is_dirty.
7 8 9 |
# File 'lib/sdb_dal/lazy_loading_text.rb', line 7 def is_dirty @is_dirty end |
Instance Method Details
#value ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/sdb_dal/lazy_loading_text.rb', line 20 def value if !@did_load @value= @get_clob_proc.call @has_loaded=true end return @value end |
#value=(v) ⇒ Object
15 16 17 18 19 |
# File 'lib/sdb_dal/lazy_loading_text.rb', line 15 def value=(v) @is_dirty=true @has_loaded=true @value=v end |