module BlommingApi

Constants

AUTHORS
DESCRIPTION
EMAILS
HOMEPAGE
SUMMARY
VERSION

Public Class Methods

about() click to toggle source
# File lib/blomming_api/help.rb, line 11
def BlommingApi::about
      "\tgem      : blomming_api (v.#{BlommingApi::VERSION})\n"\
  "\tsummary  : #{BlommingApi::SUMMARY}\n"\
  "\tauthors  : #{BlommingApi::AUTHORS.join(',')} (#{BlommingApi::EMAILS.join(',')})\n"\
  "\thomepage : #{BlommingApi::HOMEPAGE}\n"
end
authentication_help() click to toggle source
# File lib/blomming_api/help.rb, line 56
  def BlommingApi::authentication_help
    <<-CONFIGURATION_HELP
Authentication set-up

In order to be granted to access to Blomming API, each client must be identified by some credential values (oauth server authentication). 

Get your Blomming API credentials
=================================

API credentials are generated by Blomming tech team for a per 3rd part application use. Please contact [api@blomming.com](mailto:api@blomming.com) and explain briefly why do you need them and how do you plan to use Blomming service. Blomming tech team will be happy to give you the full access to API!

Buy Services Authentication
---------------------------

To access Blomming APIs, each client must be identified by two credential values required as parameters of initial Blomming OAuth server bearer token request:

- *Application ID*
- *Secret*

Sell Services Authentication
----------------------------

Application ID and Secret values, are all you need to use buy services, but in case of sell services, you must authenticate supplying also your Blomming account cusername and password:

- *Username*
- *Password*


Set-up your *blommimg_api* configuration file 
=============================================

Using the blomming_api gem, a client must be "initialized" with a YAML configuration file (.yml), in order to store all Blomming API credentials data and some default API values, among others:

- *domain* (production/staging API urls) 
- *api_version* (API release number)


You have to set-up all data on a blommimg_api YAML configuration file `<your_config_file.yml>`, following these two possible skeletons:


Config file for *BUY services* authentication
---------------------------------------------

Config file example: `your/path/to/buy_services_stage_config.yml` :

    description: my account for buy services, access to staging server 

    services: buy

    client_id: __copy_here_your_blomming_api_client_id__
    client_secret: __copy_here_your_blomming_api_client_secret__

    domain: https://blomming-api-staging.herokuapp.com
    api_version: /v1

    default_currency: USD
    default_locale: US

    verbose: false


Config file for *SELL services* authentication
----------------------------------------------

Config file example `your/path/to/buy_services_prod_config.yml`:

    description: my account for sell services, access to production server  

    services: sell

    client_id: __copy_here_your_blomming_api_client_id__
    client_secret: __copy_here_your_blomming_api_client_secret__

    username: __copy_here_your_blomming_account_username__
    password: __copy_here_your_blomming_account_password__

    domain: https://api.blomming.com
    api_version: /v1

    default_currency: EUR
    default_locale: it

    verbose: true 
  
CONFIGURATION_HELP
  end
endpoints_help() click to toggle source
# File lib/blomming_api/help.rb, line 18
def BlommingApi::endpoints_help
  puts "BUY ENDPOINTS METHODS"
  puts "=====================\n"

  buy_endpoints_methods = BlommingApi::BuyEndpoints.instance_methods(false)
  
  buy_endpoints_methods.each do |method_name|
    display_method_info method_name
  end 

  puts "SELL ENDPOINTS METHODS"
  puts "======================\n"

  sell_endpoints_methods = BlommingApi::SellEndpoints.instance_methods(false)
  
  sell_endpoints_methods.each do |method_name|
    display_method_info method_name
  end
end

Private Class Methods

display_method_info(method_name) click to toggle source
# File lib/blomming_api/help.rb, line 38
def BlommingApi::display_method_info (method_name) 
  method_comment = BlommingApi::Client.instance_method(method_name.to_sym).comment
  
  #method_comment.gsub! "#", "\t#"

  method_source = BlommingApi::Client.instance_method(method_name.to_sym).source

  method_def = method_source.split("\n").first.strip[/def (?<match>.*)/,"match"]
  location = BlommingApi::Client.instance_method(method_name.to_sym).source_location

  puts "\n#{method_comment}"
  puts "\t#{method_def}"
  puts "\tfile: #{location.first}"
  puts "\tline: #{location.last}"
end