Class: Haml::I18n::Extractor::UserAction

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(input) ⇒ UserAction

Returns a new instance of UserAction.

Raises:



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

Returns:

  • (Boolean)


35
36
37
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 35

def next?
  @input == 'N'
end

#no_replace?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 23

def no_replace?
  @input == 'n'
end

#replace_line?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 19

def replace_line?
  @input == 'y'
end

#tag?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/haml-i18n-extractor/flow/user_action.rb', line 15

def tag?
  @input == 't'
end