Class: Somemoji::CommandLineArguments

Inherits:
Object
  • Object
show all
Defined in:
lib/somemoji/command_line_arguments.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CommandLineArguments

Returns a new instance of CommandLineArguments.

Parameters:

  • argv (Array<String>)


4
5
6
# File 'lib/somemoji/command_line_arguments.rb', line 4

def initialize(argv)
  @argv = argv
end

Instance Method Details

#destinationString

Returns:

  • (String)


9
10
11
# File 'lib/somemoji/command_line_arguments.rb', line 9

def destination
  slop_parse_result[:destination]
end

#error_messageString

Returns:

  • (String)


14
15
16
# File 'lib/somemoji/command_line_arguments.rb', line 14

def error_message
  slop_options.to_s
end

#formatString?

Returns:

  • (String, nil)


19
20
21
# File 'lib/somemoji/command_line_arguments.rb', line 19

def format
  slop_parse_result[:format]
end

#provider_nameString

Returns:

  • (String)


24
25
26
# File 'lib/somemoji/command_line_arguments.rb', line 24

def provider_name
  slop_parse_result[:provider]
end

#sizeInteger?

Returns:

  • (Integer, nil)


29
30
31
# File 'lib/somemoji/command_line_arguments.rb', line 29

def size
  slop_parse_result[:size]
end

#valid?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/somemoji/command_line_arguments.rb', line 34

def valid?
   command_name == "extract" && !slop_parse_result.nil?
end