Class: Arturo::NoSuchFeature

Inherits:
Object
  • Object
show all
Defined in:
lib/arturo/no_such_feature.rb

Overview

A Null-Object stand-in for a Feature.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol) ⇒ NoSuchFeature

Returns a new instance of NoSuchFeature.

Raises:

  • (ArgumentError)


9
10
11
12
# File 'lib/arturo/no_such_feature.rb', line 9

def initialize(symbol)
  raise ArgumentError.new(I18n.t('arturo.no_such_feature.symbol_required')) if symbol.nil?
  @symbol = symbol
end

Instance Attribute Details

#symbolObject (readonly)

Returns the value of attribute symbol.



7
8
9
# File 'lib/arturo/no_such_feature.rb', line 7

def symbol
  @symbol
end

Instance Method Details

#enabled_for?(feature_recipient) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/arturo/no_such_feature.rb', line 14

def enabled_for?(feature_recipient)
  false
end

#inspectObject



24
25
26
# File 'lib/arturo/no_such_feature.rb', line 24

def inspect
  "<Arturo::NoSuchFeature #{symbol}>"
end

#nameObject Also known as: to_s



18
19
20
# File 'lib/arturo/no_such_feature.rb', line 18

def name
  I18n.t('arturo.no_such_feature.name', :symbol => symbol)
end