module Cropio

Cropio-Ruby provides simple ActiveRecord-like wrappings for Cropio API. Currently it supports Cropio APIv3.

Main gem's module Cropio contains accessors for credentials and other stuff

Constants

VERSION

Public Class Methods

api_token=(token) click to toggle source

Setter for user api_token we can use this token for authenticate user without login and password

# File lib/cropio.rb, line 35
def self.api_token=(token)
  @credentials = OpenStruct.new(api_token: token)
end
credentials() click to toggle source

Getter for credentials

# File lib/cropio.rb, line 15
def self.credentials
  @credentials
end
credentials=(credentials) click to toggle source

Setter for credentials, accepts Hash or OpenStruct with email and password or api_token as param

# File lib/cropio.rb, line 22
def self.credentials=(credentials)
  case credentials
  when Hash
    @credentials = OpenStruct.new(credentials)
  when OpenStruct
    @credentials = credentials
  else
    fail 'Cropio credentials should be a Hash or OpenStruct.'
  end
end