Class: Arturo::NoSuchFeature
- Inherits:
-
Object
- Object
- Arturo::NoSuchFeature
- Defined in:
- lib/arturo/no_such_feature.rb
Overview
A Null-Object stand-in for a Feature.
Instance Attribute Summary collapse
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
- #enabled_for?(feature_recipient) ⇒ Boolean
-
#initialize(symbol) ⇒ NoSuchFeature
constructor
A new instance of NoSuchFeature.
- #inspect ⇒ Object
- #name ⇒ Object (also: #to_s)
Constructor Details
#initialize(symbol) ⇒ NoSuchFeature
Returns a new instance of NoSuchFeature.
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
#symbol ⇒ Object (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
14 15 16 |
# File 'lib/arturo/no_such_feature.rb', line 14 def enabled_for?(feature_recipient) false end |
#inspect ⇒ Object
24 25 26 |
# File 'lib/arturo/no_such_feature.rb', line 24 def inspect "<Arturo::NoSuchFeature #{symbol}>" end |
#name ⇒ Object 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 |