Class: Isomorfeus::Puppetmaster::ConsoleMessage
- Inherits:
-
Object
- Object
- Isomorfeus::Puppetmaster::ConsoleMessage
- Defined in:
- lib/isomorfeus/puppetmaster/console_message.rb
Instance Method Summary collapse
-
#initialize(message_hash = {}) ⇒ ConsoleMessage
constructor
A new instance of ConsoleMessage.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize(message_hash = {}) ⇒ ConsoleMessage
Returns a new instance of ConsoleMessage.
4 5 6 |
# File 'lib/isomorfeus/puppetmaster/console_message.rb', line 4 def initialize( = {}) @message_hash = ? : {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/isomorfeus/puppetmaster/console_message.rb', line 8 def method_missing(name, *args) if %i[column_number level location line_number text].include?(name) @message_hash[name.to_s] elsif %i[location url].include?(name) @message_hash['location'] ? @message_hash['location']['url'] : '' else super(name, *args) end end |