Use attr_reader for a couple methods
attr_reader methods are faster than normal methods.
This commit is contained in:
parent
e605a964e8
commit
56e78dac1e
|
@ -8,9 +8,9 @@ module Tilt
|
|||
|
||||
@default_mapping = Mapping.new
|
||||
|
||||
# @return [Tilt::Mapping] the main mapping object
|
||||
def self.default_mapping
|
||||
@default_mapping
|
||||
class << self
|
||||
# @return [Tilt::Mapping] the main mapping object
|
||||
attr_reader :default_mapping
|
||||
end
|
||||
|
||||
# @private
|
||||
|
|
|
@ -155,9 +155,7 @@ module Tilt
|
|||
# default_encoding-option if present. You may override this method
|
||||
# in your template class if you have a better hint of the data's
|
||||
# encoding.
|
||||
def default_encoding
|
||||
@default_encoding
|
||||
end
|
||||
attr_reader :default_encoding
|
||||
|
||||
# Do whatever preparation is necessary to setup the underlying template
|
||||
# engine. Called immediately after template data is loaded. Instance
|
||||
|
|
Loading…
Reference in New Issue