Sha256: 551d767678baee3e0e2b8b989afa8cb23ff51b1f296c20040af9793876bb91ef

Contents?: true

Size: 441 Bytes

Versions: 8

Compression:

Stored size: 441 Bytes

Contents

module NotRelational

 

class LazyLoadingText
  attr_reader :is_dirty
   attr_reader :has_loaded
  def initialize(get_text_proc)
    @get_text_proc=get_text_proc
    @has_loaded=false
    @is_dirty=false
  end
  
  def value=(v)
    @is_dirty=true
    @has_loaded=true
    @value=v
  end
  def value
    if !@did_load
        @value= @get_text_proc.call      
        @has_loaded=true          
    end
    return @value
    
  end
end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cloudwow-not_relational-0.1.11 lib/not_relational/lazy_loading_text.rb
cloudwow-not_relational-0.1.2 lib/not_relational/lazy_loading_text.rb
cloudwow-not_relational-0.1.3 lib/not_relational/lazy_loading_text.rb
cloudwow-not_relational-0.1.5 lib/not_relational/lazy_loading_text.rb
cloudwow-not_relational-0.1.6 lib/not_relational/lazy_loading_text.rb
cloudwow-not_relational-0.1.7 lib/not_relational/lazy_loading_text.rb
cloudwow-not_relational-0.1.8 lib/not_relational/lazy_loading_text.rb
cloudwow-not_relational-0.1.9 lib/not_relational/lazy_loading_text.rb