Class: HamlUserTags::LazyContents

Inherits:
String
  • Object
show all
Defined in:
lib/haml_user_tags/helpers.rb

Instance Method Summary collapse

Constructor Details

#initialize(&generator) ⇒ LazyContents

Returns a new instance of LazyContents.



45
46
47
# File 'lib/haml_user_tags/helpers.rb', line 45

def initialize(&generator)
  @generator = generator
end

Instance Method Details

#__getobj__Object



49
50
51
52
53
54
# File 'lib/haml_user_tags/helpers.rb', line 49

def __getobj__
  unless @results
    @results, @generator = @generator.call, nil
  end
  @results
end