Sha256: cfd5efdd18768b526b67e0b694a0ea70b5d4be93c06edeb8f2f119c58430e2aa
Contents?: true
Size: 893 Bytes
Versions: 11
Compression:
Stored size: 893 Bytes
Contents
module APIClientBase module Response def self.module(opts={}) mod = Module.new do mattr_accessor :api_client_base_response_options def self.included(base) base.class_attribute :api_client_base_response_options base.api_client_base_response_options = self.api_client_base_response_options base.send :include, APIClientBase::Response end end mod.api_client_base_response_options = opts mod end extend ActiveSupport::Concern included do include Virtus.model attribute :raw_response, Object attribute :success, self::Boolean, lazy: true, default: :default_success attribute :code, Integer, lazy: true, default: :default_code end def default_success raw_response.success? end def default_code raw_response.code end end end
Version data entries
11 entries across 11 versions & 1 rubygems