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)


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

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.



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

def symbol
  @symbol
end

Instance Method Details

#enabled_for?(feature_recipient) ⇒ Boolean

Returns:

  • (Boolean)


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

def enabled_for?(feature_recipient)
  false
end

#inspectObject



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

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

#nameObject Also known as: to_s



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

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