Class: BBGAPI::Blocks_Products

Inherits:
Object
  • Object
show all
Defined in:
lib/bbgapi/blocks_products.rb

Class Method Summary collapse

Class Method Details

.listObject



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bbgapi/blocks_products.rb', line 16

def self.list
  partial = '/api/block_products'
  api_response = BBGAPI::Client.geturl(partial,"")

  api_response.each {|x|
    puts "\n"
    puts "Cost:        #{x["cost"]}"
    puts "ID:          #{x["id"]}"
    puts "Description: #{x["description"]}"
  }
  puts "\n"
end


3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/bbgapi/blocks_products.rb', line 3

def self.menulist
  choose do |menu|
    puts "Blocks"
    puts "----------------------------------------"
    menu.prompt = "Which Action?"

    menu.choices(:list) {self.list}
    menu.choices(:create) {self.tbi}
    menu.choices(:update) {self.tbi}
    menu.choices(:delete) {self.tbi}
  end
end

.rawObject



29
30
31
32
33
# File 'lib/bbgapi/blocks_products.rb', line 29

def self.raw
  partial = '/api/block_products'
  api_response = BBGAPI::Client.geturl(partial,"")
  return api_response
end

.tbiObject



36
37
38
# File 'lib/bbgapi/blocks_products.rb', line 36

def self.tbi
  puts "This is not yet implemented"
end