Sha256: d3e72bfb59f301899f9bff3e4273c48e8cc3e204d42b90313936552cd624e7d9
Contents?: true
Size: 683 Bytes
Versions: 12
Compression:
Stored size: 683 Bytes
Contents
module Avo class License attr_accessor :id attr_accessor :response attr_accessor :valid def initialize(response) @response = response @id = response['id'] @valid = response['valid'] 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' 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
Version data entries
12 entries across 12 versions & 1 rubygems