Class: SocialUrl::Message
- Inherits:
-
Object
- Object
- SocialUrl::Message
- Defined in:
- lib/social_url/message.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Message
constructor
A new instance of Message.
- #method_missing(method) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/social_url/message.rb', line 9 def method_missing(method) network = /(.+)_url/.match(method) return unless network networks = SocialUrl.networks.join(',') raise UnsupportedNetworkError, "Unsupported network '#{network[1]}'. Choose from: #{networks}." end |