mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Silence uninitialised instance var warning.
Use `haml_buffer` method instead of directly accessing `@haml_buffer` and check for `@haml_buffer` being defined in method. Use explicit `haml_buffer` method rather than `attr` as the latter generates `private attribute?` warning.
This commit is contained in:
parent
cb6e52186e
commit
e62101b44f
2 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ module Haml
|
|||
preamble = <<END.gsub("\n", ";")
|
||||
begin
|
||||
extend Haml::Helpers
|
||||
_hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, #{options_for_buffer.inspect})
|
||||
_hamlout = @haml_buffer = Haml::Buffer.new(haml_buffer, #{options_for_buffer.inspect})
|
||||
_erbout = _hamlout.buffer
|
||||
__in_erb_template = true
|
||||
END
|
||||
|
|
|
@ -70,7 +70,7 @@ MESSAGE
|
|||
# context.haml_tag :p, "Stuff"
|
||||
#
|
||||
def init_haml_helpers
|
||||
@haml_buffer = Haml::Buffer.new(@haml_buffer, Haml::Engine.new('').send(:options_for_buffer))
|
||||
@haml_buffer = Haml::Buffer.new(haml_buffer, Haml::Engine.new('').send(:options_for_buffer))
|
||||
nil
|
||||
end
|
||||
|
||||
|
@ -599,7 +599,7 @@ MESSAGE
|
|||
#
|
||||
# @return [Haml::Buffer]
|
||||
def haml_buffer
|
||||
@haml_buffer
|
||||
@haml_buffer if defined? @haml_buffer
|
||||
end
|
||||
|
||||
# Gives a proc the same local `_hamlout` and `_erbout` variables
|
||||
|
|
Loading…
Add table
Reference in a new issue