Class: MessageManager
- Inherits:
-
Object
- Object
- MessageManager
- Defined in:
- lib/message_manager.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
-
#initialize ⇒ MessageManager
constructor
A new instance of MessageManager.
- #method_missing(m) ⇒ Object
Constructor Details
#initialize ⇒ MessageManager
Returns a new instance of MessageManager.
7 8 9 10 |
# File 'lib/message_manager.rb', line 7 def initialize strings_location = File.dirname(File.(__FILE__)) + "/strings.yml" = YAML::load(File.open(strings_location))["messages"] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m) ⇒ Object
12 13 14 |
# File 'lib/message_manager.rb', line 12 def method_missing(m) [m] ? [m] : super end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
5 6 7 |
# File 'lib/message_manager.rb', line 5 def end |