Remove attrs Repubmark::Setup#locale, #prologue
This commit is contained in:
parent
093d6938c8
commit
1a233ac6aa
2 changed files with 1 additions and 26 deletions
|
@ -21,7 +21,6 @@ module Repubmark
|
|||
|
||||
def to_html
|
||||
[
|
||||
setup.prologue,
|
||||
@annotation&.to_html,
|
||||
@chapter&.to_html,
|
||||
setup.epilogue,
|
||||
|
@ -30,7 +29,6 @@ module Repubmark
|
|||
|
||||
def to_gemtext
|
||||
[
|
||||
setup.prologue,
|
||||
@annotation&.to_gemtext,
|
||||
@chapter&.to_gemtext,
|
||||
setup.epilogue,
|
||||
|
|
|
@ -8,35 +8,12 @@ module Repubmark
|
|||
freeze
|
||||
end
|
||||
|
||||
attr_reader :prologue, :epilogue
|
||||
|
||||
def prologue=(prologue)
|
||||
prologue = String(prologue).strip.freeze
|
||||
prologue = nil if prologue.empty?
|
||||
@prologue = prologue
|
||||
end
|
||||
attr_reader :epilogue
|
||||
|
||||
def epilogue=(epilogue)
|
||||
epilogue = String(epilogue).strip.freeze
|
||||
epilogue = nil if epilogue.empty?
|
||||
@epilogue = epilogue
|
||||
end
|
||||
|
||||
##########
|
||||
# Locale #
|
||||
##########
|
||||
|
||||
LOCALE_RE = /\A[a-z]{2,3}\z/
|
||||
DEFAULT_LOCALE = :en
|
||||
|
||||
def locale = @locale || DEFAULT_LOCALE
|
||||
|
||||
def locale=(locale)
|
||||
locale = String(locale).to_sym
|
||||
raise 'Invalid locale' unless LOCALE_RE.match? locale
|
||||
raise 'Locale has already been set' if @locale
|
||||
|
||||
@locale = locale
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue