Class: BGPView::Ip

Inherits:
Object
  • Object
show all
Defined in:
lib/bgpview/ip.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Ip

Returns a new instance of Ip.



5
6
7
# File 'lib/bgpview/ip.rb', line 5

def initialize(data)
  @data = data
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/bgpview/ip.rb', line 9

def method_missing(method, *args)
  if @data.key?(method.to_sym)
    @data[method.to_sym]
  else
    super
  end
end