Sha256: 28fcc8fae8293722d229c6e133f1fd6a91fd7eb550bb97a7238b3e8fd4b53887
Contents?: true
Size: 861 Bytes
Versions: 1
Compression:
Stored size: 861 Bytes
Contents
dir = File.dirname(__FILE__) + '/../lib' $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) #require 'rubygems' require 'amee' require 'optparse' # Command-line options - get username, password, and server options = {} OptionParser.new do |opts| opts.on("-u", "--username USERNAME", "AMEE username") do |u| options[:username] = u end opts.on("-p", "--password PASSWORD", "AMEE password") do |p| options[:password] = p end opts.on("-s", "--server SERVER", "AMEE server") do |s| options[:server] = s end end.parse! # Connect connection = AMEE::Connection.new(options[:server], options[:username], options[:password]) # Create a new profile item item = AMEE::Profile::Item.get(connection, ARGV[0]) puts "loaded item #{item.name}" item.values.each do |x| puts " - #{x[:name]}: #{x[:value]}" end puts " - total: #{item.total_amount}"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
amee-2.7.0 | examples/view_profile_item.rb |