Sha256: 19071782705aac06e0fa0598e0d035dd64dc68e15ca55927b7c1f274d8b4bed6
Contents?: true
Size: 662 Bytes
Versions: 28
Compression:
Stored size: 662 Bytes
Contents
require 'api_resource/associations/resource_scope' module ApiResource module Associations class DynamicResourceScope < ResourceScope attr_accessor :dynamic_value # initializer - set up the dynamic value def initialize(klass, current_scope, dynamic_value, opts = {}) self.dynamic_value = dynamic_value super(klass, current_scope, opts) end # get the to_query value for this resource scope def to_hash hsh = self.scopes[self.current_scope].clone hsh.each_pair do |k,v| hsh[k] = self.dynamic_value end self.parent_hash.merge(hsh) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems