Sha256: 4d943fbf7b981b8707575489bf802774469bdda03dccadb38523b32a6da324ab
Contents?: true
Size: 795 Bytes
Versions: 3
Compression:
Stored size: 795 Bytes
Contents
require 'resource_set/inheritable_attribute' module ResourceSet class Resource extend InheritableAttribute inheritable_attr :_resources attr_reader :connection, :scope def initialize(connection: nil, scope: nil) @connection = connection @scope = scope end def self.resources(&block) self._resources ||= ResourceCollection.new if block_given? self._resources.instance_eval(&block) MethodFactory.construct(self, self._resources) end self._resources end def action(name) _resources.find_action(name) end def action_and_connection(action_name) ActionConnection.new(action(action_name), connection) end private def _resources self.class._resources end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
resource_set-1.0.2 | lib/resource_set/resource.rb |
resource_set-1.0.1 | lib/resource_set/resource.rb |
resource_set-1.0.0 | lib/resource_set/resource.rb |