Class: Usps::Imis::CommandLine::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/usps/imis/command_line/interface.rb

Overview

Command line interface for the Api

Constant Summary collapse

NAME =
'USPS iMIS API - Ruby'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInterface

Returns a new instance of Interface.



15
16
17
18
19
20
# File 'lib/usps/imis/command_line/interface.rb', line 15

def initialize(**)
  @options = input_options.merge(**)
  validate_options!
  configure! if options[:config]
  logging!
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/usps/imis/command_line/interface.rb', line 11

def options
  @options
end

Class Method Details

.runObject



13
# File 'lib/usps/imis/command_line/interface.rb', line 13

def self.run(...) = new(...).run

Instance Method Details

#runObject



22
23
24
25
26
27
28
29
30
# File 'lib/usps/imis/command_line/interface.rb', line 22

def run
  set_member

  result = simplify(perform!)

  output { result }

  result
end