Created
September 15, 2017 11:56
-
-
Save ugdark/58b030c9dbb25e601001729c21427685 to your computer and use it in GitHub Desktop.
@configをincludeで参照できなくしたい。または代案
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'yosenabe/config' | |
module Yosenabe | |
module Mixin | |
# 基本のconfigload用 | |
module MixinConfig | |
# def self.included(args) | |
# @config = Yosenabe.config | |
# end | |
def config | |
# TODO: @configは隠したい | |
if @config.nil? | |
@config = Yosenabe.config | |
end | |
@config | |
end | |
end | |
module DummyConfig | |
# テストでは拡張してconfigを追加してください | |
def config | |
{} | |
end | |
end | |
end | |
end | |
class BoxCopy | |
include Yosenabe::Mixin::MixinNotifierLogger | |
# include Yosenabe::Mixin::DummyNotifierLogger とかで簡単に切り替えたい | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment