Class: IControl::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/icontrol/base.rb,
lib/icontrol/base/struct.rb,
lib/icontrol/base/sequence.rb,
lib/icontrol/base/mappings.rb,
lib/icontrol/base/exception.rb,
lib/icontrol/base/enumeration.rb,
lib/icontrol/base/attributable.rb

Direct Known Subclasses

ARX::Api, ARX::Chassis, ARX::Export, ARX::FileChangeNotification, ARX::FileServer, ARX::Namespace, ARX::Network, ARX::Policy, ARX::Share, ARX::VirtualService, ARX::Volume, ASM::ObjectParams, ASM::Policy, ASM::SystemConfiguration, ASM::WebApplication, ASM::WebApplicationGroup, GlobalLB::Application, GlobalLB::DNSSECKey, GlobalLB::DNSSECZone, GlobalLB::DataCenter, GlobalLB::Globals, GlobalLB::Link, GlobalLB::Monitor, GlobalLB::Pool, GlobalLB::PoolMember, GlobalLB::Region, GlobalLB::Rule, GlobalLB::Server, GlobalLB::Topology, GlobalLB::VirtualServer, GlobalLB::WideIP, LTConfig::Field, LTConfig::Klass, LocalLB::Klass, LocalLB::Monitor, LocalLB::NAT, LocalLB::NodeAddress, LocalLB::Pool, LocalLB::PoolMember, LocalLB::ProfileAuth, LocalLB::ProfileClientSSL, LocalLB::ProfileDNS, LocalLB::ProfileDiameter, LocalLB::ProfileFTP, LocalLB::ProfileFastHttp, LocalLB::ProfileFastL4, LocalLB::ProfileHttp, LocalLB::ProfileHttpClass, LocalLB::ProfileIIOP, LocalLB::ProfileOneConnect, LocalLB::ProfilePersistence, LocalLB::ProfileRADIUS, LocalLB::ProfileRTSP, LocalLB::ProfileSCTP, LocalLB::ProfileSIP, LocalLB::ProfileServerSSL, LocalLB::ProfileStream, LocalLB::ProfileTCP, LocalLB::ProfileUDP, LocalLB::ProfileUserStatistic, LocalLB::ProfileXML, LocalLB::RAMCacheInformation, LocalLB::RateClass, LocalLB::Rule, LocalLB::SNAT, LocalLB::SNATPool, LocalLB::SNATPoolMember, LocalLB::SNATTranslationAddress, LocalLB::VirtualAddress, LocalLB::VirtualServer, Management::CCLDAPConfiguration, Management::CRLDPConfiguration, Management::CRLDPServer, Management::ChangeControl, Management::DBVariable, Management::EventNotification, Management::EventSubscription, Management::KeyCertificate, Management::LDAPConfiguration, Management::LicenseAdministration, Management::Named, Management::OCSPConfiguration, Management::OCSPResponder, Management::Partition, Management::Provision, Management::RADIUSConfiguration, Management::RADIUSServer, Management::ResourceRecord, Management::SNMPConfiguration, Management::TACACSConfiguration, Management::TMOSModule, Management::UserManagement, Management::View, Management::Zone, Management::ZoneRunner, Networking::ARP, Networking::AdminIP, Networking::ISessionAdvertisedRoute, Networking::ISessionLocalInterface, Networking::ISessionPeerDiscovery, Networking::ISessionRemoteInterface, Networking::Interfaces, Networking::PacketFilter, Networking::PacketFilterGlobals, Networking::PortMirror, Networking::ProfileGRE, Networking::ProfileIPIP, Networking::ProfileWCCPGRE, Networking::RouteDomain, Networking::RouteTable, Networking::STPGlobals, Networking::STPInstance, Networking::SelfIP, Networking::SelfIPPortLockdown, Networking::Trunk, Networking::Tunnel, Networking::VLAN, Networking::VLANGroup, System::Cluster, System::ConfigSync, System::Connections, System::Disk, System::Failover, System::GeoIP, System::Inet, System::Internal, System::Services, System::SoftwareManagement, System::Statistics, System::SystemInfo, WebAccelerator::Applications, WebAccelerator::Policies, WebAccelerator::ProxyMessage

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/icontrol/base.rb', line 295

def method_missing(method_name,*args,&block)
  # When calling an instance method we first check whether there is an argument with
  # that name and return it. If that is not the case we fallback in the class default method but adding the instance as
  # argument (the id), cause thats the way the api works, passing the id
  
  return super if @attributes.has_key? method_name 
  method_name = "get_#{method_name}" if getters.include? method_name
  call_arguments = ( args.first || {} ).merge(default_body)

  return self.class.send(method_name,call_arguments,&block)

end