17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/code-box/code_attribute.rb', line 17
def self.included(base)
unless (class << self; self; end).method_defined?(:_code_box_i18n_model_segment)
instance_eval <<-RUBY_
class << self
def _code_box_i18n_model_segment
nil
end
end
RUBY_
end
base.extend(ClassMethods)
instance_eval <<-RUBY_
class << base
def _code_box_i18n_model_segment
return CodeBox.i18n_model_segment if "#{self._code_box_i18n_model_segment}".empty?
"#{self._code_box_i18n_model_segment}"
end
end
RUBY_
end
|