Class: Sunzi::DNS
- Inherits:
-
Object
- Object
- Sunzi::DNS
- Defined in:
- lib/sunzi.rb,
lib/sunzi/dns.rb,
lib/sunzi/dns/base.rb,
lib/sunzi/dns/linode.rb,
lib/sunzi/dns/route53.rb
Defined Under Namespace
Classes: Base, Linode, Route53
Instance Method Summary collapse
-
#initialize(config, cloud) ⇒ DNS
constructor
A new instance of DNS.
- #method_missing(sym, *args, &block) ⇒ Object
Constructor Details
#initialize(config, cloud) ⇒ DNS
Returns a new instance of DNS.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/sunzi/dns.rb', line 3 def initialize(config, cloud) dns = config['dns'] @subject = case dns when 'linode' Sunzi::DNS::Linode.new(config, cloud) when 'route53' Sunzi::DNS::Route53.new(config, cloud) else abort_with "DNS #{dns} is not valid!" end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
15 16 17 |
# File 'lib/sunzi/dns.rb', line 15 def method_missing(sym, *args, &block) @subject.send sym, *args, &block end |