Sha256: 7ca5d831f42de524abe37e17fa2f88c9d5f53a0df62be732d26ffc9d3c16e12d
Contents?: true
Size: 864 Bytes
Versions: 23
Compression:
Stored size: 864 Bytes
Contents
module Avo module Licensing class License attr_accessor :id attr_accessor :response attr_accessor :valid attr_accessor :payload def initialize(response) @response = response @id = response["id"] @valid = response["valid"] @payload = response["payload"] end def valid? valid end def invalid? !valid? end def pro? id == "pro" end def error @response["error"] end def properties @response.slice("valid", "id", "error").symbolize_keys end def abilities [] end def can(ability) abilities.include? ability end def cant(ability) !can ability end alias_method :has, :can alias_method :lacks, :cant end end end
Version data entries
23 entries across 23 versions & 1 rubygems