Module: ECMBlockchain

Defined in:
lib/ecm-blockchain-api.rb,
lib/ecm-blockchain-api/ca.rb,
lib/ecm-blockchain-api/asset.rb,
lib/ecm-blockchain-api/token.rb,
lib/ecm-blockchain-api/client.rb,
lib/ecm-blockchain-api/errors.rb,
lib/ecm-blockchain-api/routes.rb,
lib/ecm-blockchain-api/request.rb,
lib/ecm-blockchain-api/version.rb,
lib/ecm-blockchain-api/models/member.rb,
lib/ecm-blockchain-api/models/asset_model.rb,
lib/ecm-blockchain-api/models/token_model.rb,
lib/ecm-blockchain-api/models/data_file_model.rb,
lib/ecm-blockchain-api/models/custom_attribute.rb,
lib/ecm-blockchain-api/models/token_collection.rb,
lib/ecm-blockchain-api/models/data_content_file.rb,
lib/ecm-blockchain-api/models/data_content_model.rb,
lib/ecm-blockchain-api/models/digital_signature_model.rb

Defined Under Namespace

Modules: Request, Routes Classes: Asset, AssetModel, BadGateway, BadRequest, CA, Client, CustomAttribute, DataContent, DataFile, DigitalSignature, Error, Forbidden, GatewayTimeout, InternalServerError, Member, NotAcceptable, NotFound, PaymentRequired, RequestEntityTooLarge, ServerError, ServiceUnavailable, TimeoutError, TokenModel, Tokens, TokensCollection, TooManyRequests, Unauthorized, UnprocessableEntityError

Constant Summary collapse

ERROR_CLASS_MAP =
{
  400 => ECMBlockchain::BadRequest,
  401 => ECMBlockchain::Unauthorized,
  402 => ECMBlockchain::PaymentRequired,
  403 => ECMBlockchain::Forbidden,
  404 => ECMBlockchain::NotFound,
  406 => ECMBlockchain::NotAcceptable,
  413 => ECMBlockchain::RequestEntityTooLarge,
  422 => ECMBlockchain::UnprocessableEntityError,
  429 => ECMBlockchain::TooManyRequests,
  500 => ECMBlockchain::InternalServerError,
  502 => ECMBlockchain::BadGateway,
  503 => ECMBlockchain::ServiceUnavailable,
  504 => ECMBlockchain::GatewayTimeout,
}.freeze
VERSION =
"1.1.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.access_tokenObject

Returns the value of attribute access_token.



28
29
30
# File 'lib/ecm-blockchain-api.rb', line 28

def access_token
  @access_token
end

.base_urlObject

Returns the value of attribute base_url.



28
29
30
# File 'lib/ecm-blockchain-api.rb', line 28

def base_url
  @base_url
end

.loggerObject

Returns the value of attribute logger.



28
29
30
# File 'lib/ecm-blockchain-api.rb', line 28

def logger
  @logger
end

Class Method Details

.has_api_key?Boolean

Returns:

  • (Boolean)

Raises:



30
31
32
33
34
35
36
# File 'lib/ecm-blockchain-api.rb', line 30

def has_api_key?
  return unless ECMBlockchain.access_token.to_s.empty?
  raise Unauthorized.new( 
    message: "You need to set your access_token", 
    code: 401,
    name: Unauthorized)  
end