Class: Arbitrage::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/arbitrage/cli.rb

Overview

CLI Controller

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



5
6
7
8
9
# File 'lib/arbitrage/cli.rb', line 5

def initialize
  self.validator = Arbitrage::InputValidator.new
  self.product = Arbitrage::Product.new
  self.profit = Arbitrage::Profit.new(self.product)
end

Instance Attribute Details

#market_valueObject

Returns the value of attribute market_value.



3
4
5
# File 'lib/arbitrage/cli.rb', line 3

def market_value
  @market_value
end

#productObject

Returns the value of attribute product.



3
4
5
# File 'lib/arbitrage/cli.rb', line 3

def product
  @product
end

#profitObject

Returns the value of attribute profit.



3
4
5
# File 'lib/arbitrage/cli.rb', line 3

def profit
  @profit
end

#validatorObject

Returns the value of attribute validator.



3
4
5
# File 'lib/arbitrage/cli.rb', line 3

def validator
  @validator
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/arbitrage/cli.rb', line 11

def call
  puts "What's your zipcode?"
  self.product.get_zipcode
  self.product.get_product
  puts "Details on the product you've selected:"
  puts "______________________________________"
  puts self.product.display_product_details
  puts "______________________________________"
  self.profit.list_opportunity
  #puts "your potential profit on the sale of #{self.product.name} is $#{gross_profit}"
end