Class: Twing::Modules::Base
- Inherits:
-
Object
- Object
- Twing::Modules::Base
- Defined in:
- lib/twing/modules/base.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#root_setting ⇒ Object
readonly
Returns the value of attribute root_setting.
-
#setting ⇒ Object
readonly
Returns the value of attribute setting.
Instance Method Summary collapse
-
#initialize(app) ⇒ Base
constructor
A new instance of Base.
- #on_message(*args) ⇒ Object
Constructor Details
#initialize(app) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/twing/modules/base.rb', line 8 def initialize(app) @app = app @logger = CustomLogger.new(app.logger, self.class.to_s) @root_setting = app.setting @setting = app.setting.modules[self.class.to_s.downcase] end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/twing/modules/base.rb', line 6 def app @app end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/twing/modules/base.rb', line 6 def logger @logger end |
#root_setting ⇒ Object (readonly)
Returns the value of attribute root_setting.
6 7 8 |
# File 'lib/twing/modules/base.rb', line 6 def root_setting @root_setting end |
#setting ⇒ Object (readonly)
Returns the value of attribute setting.
6 7 8 |
# File 'lib/twing/modules/base.rb', line 6 def setting @setting end |
Instance Method Details
#on_message(*args) ⇒ Object
15 16 17 |
# File 'lib/twing/modules/base.rb', line 15 def (*args) raise NotImplementedError.new("You must implement #{self.class}##{__method__}") end |