Class: Haml::I18n::Extractor::UserAction
- Inherits:
-
Object
- Object
- Haml::I18n::Extractor::UserAction
- Defined in:
- lib/haml-i18n-extractor/flow/user_action.rb
Defined Under Namespace
Classes: Unsupported
Constant Summary collapse
- SUPPORTED =
overwrite, dump, next, yes, no, tag
%w(O D N y n t)
Instance Method Summary collapse
-
#initialize(input) ⇒ UserAction
constructor
A new instance of UserAction.
-
#next? ⇒ Boolean
end.
- #no_replace? ⇒ Boolean
- #replace_line? ⇒ Boolean
- #tag? ⇒ Boolean
Constructor Details
#initialize(input) ⇒ UserAction
Returns a new instance of UserAction.
10 11 12 13 |
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 10 def initialize(input) raise Unsupported, "Only #{SUPPORTED.join(",")} are allowed for user input" unless SUPPORTED.include?(input) @input = input end |
Instance Method Details
#next? ⇒ Boolean
end
35 36 37 |
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 35 def next? @input == 'N' end |
#no_replace? ⇒ Boolean
23 24 25 |
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 23 def no_replace? @input == 'n' end |
#replace_line? ⇒ Boolean
19 20 21 |
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 19 def replace_line? @input == 'y' end |
#tag? ⇒ Boolean
15 16 17 |
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 15 def tag? @input == 't' end |