Class: Natsukantou::Env
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Natsukantou::Env
- Defined in:
- lib/natsukantou/utility/env.rb
Instance Method Summary collapse
- #dom ⇒ Object
-
#initialize(env) ⇒ Env
constructor
A new instance of Env.
- #lang_from ⇒ Object
- #lang_to ⇒ Object
Constructor Details
#initialize(env) ⇒ Env
Returns a new instance of Env.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/natsukantou/utility/env.rb', line 14 def initialize(env) # Convert languages [:lang_from, :lang_to].each do |key| lang = env.fetch(key) next if lang.is_a?(LanguageCode) env[key] = LanguageCode.new(lang) end # Required keys [:dom].each do |key| env.fetch(key) end super(env) end |
Instance Method Details
#dom ⇒ Object
31 32 33 |
# File 'lib/natsukantou/utility/env.rb', line 31 def dom self[:dom] end |
#lang_from ⇒ Object
35 36 37 |
# File 'lib/natsukantou/utility/env.rb', line 35 def lang_from self[:lang_from] end |
#lang_to ⇒ Object
39 40 41 |
# File 'lib/natsukantou/utility/env.rb', line 39 def lang_to self[:lang_to] end |