Sha256: 8f5f0f48762c6f56655e09a7ce58e3bc05bde7526bbc861ce499d976c1a217cf
Contents?: true
Size: 640 Bytes
Versions: 10
Compression:
Stored size: 640 Bytes
Contents
module ApiClient module Mixins module Instantiation def self.extended(base) base.instance_eval do attr_accessor :original_scope end end def build_one(hash) instance = self.new self.namespace ? hash[namespace] : hash instance.original_scope = self.scope instance end def build_many(array) array.collect { |one| build_one(one) } end def build(result_or_array) if result_or_array.is_a?(Array) build_many result_or_array else build_one result_or_array end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems