Class: WifiWand::Commands::Base::LazyModel

Inherits:
Object
  • Object
show all
Defined in:
lib/wifi_wand/commands/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(cli) ⇒ LazyModel

Returns a new instance of LazyModel.



32
33
34
# File 'lib/wifi_wand/commands/base.rb', line 32

def initialize(cli)
  @cli = cli
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



36
37
38
# File 'lib/wifi_wand/commands/base.rb', line 36

def method_missing(method_name, ...)
  model.public_send(method_name, ...)
end

Instance Method Details

#==(other) ⇒ Object



50
51
52
# File 'lib/wifi_wand/commands/base.rb', line 50

def ==(other)
  model == other
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/wifi_wand/commands/base.rb', line 54

def eql?(other)
  model.eql?(other)
end

#hashObject



58
59
60
# File 'lib/wifi_wand/commands/base.rb', line 58

def hash
  model.hash
end

#inspectObject



62
63
64
# File 'lib/wifi_wand/commands/base.rb', line 62

def inspect
  model.inspect
end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
43
44
45
46
47
48
# File 'lib/wifi_wand/commands/base.rb', line 40

def respond_to_missing?(method_name, include_private = false)
  model_responds = if include_private
    model.respond_to?(method_name, true)
  else
    model.respond_to?(method_name)
  end

  model_responds || super
end