Class: WifiWand::Platforms::Selection::Base

Inherits:
Struct
  • Object
show all
Defined in:
lib/wifi_wand/platforms/selection/base.rb

Direct Known Subclasses

Mac, Ubuntu

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, display_name) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
16
17
18
19
# File 'lib/wifi_wand/platforms/selection/base.rb', line 11

def initialize(id, display_name)
  instantiated_by_subclass = (self.class.name != WifiWand::Platforms::Selection::Base.name)
  if instantiated_by_subclass
    super
  else
    # Prohibit Base.new call
    raise NonSubclassInstantiationError
  end
end

Instance Attribute Details

#display_nameObject

Returns the value of attribute display_name

Returns:

  • (Object)

    the current value of display_name



10
11
12
# File 'lib/wifi_wand/platforms/selection/base.rb', line 10

def display_name
  @display_name
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



10
11
12
# File 'lib/wifi_wand/platforms/selection/base.rb', line 10

def id
  @id
end

Instance Method Details

#create_model(_options) ⇒ Object



23
# File 'lib/wifi_wand/platforms/selection/base.rb', line 23

def create_model(_options) = raise MethodNotImplementedError

#current_os_is_this_os?Boolean

Returns:

  • (Boolean)

Raises:



21
# File 'lib/wifi_wand/platforms/selection/base.rb', line 21

def current_os_is_this_os? = raise MethodNotImplementedError