Sha256: 6b64d5711828a1309f54bbb5f927816c7a361e366862a026c6b59a96e35f0271
Contents?: true
Size: 630 Bytes
Versions: 12
Compression:
Stored size: 630 Bytes
Contents
module Myfinance module Resources class Base attr_accessor :http def initialize(http) @http = http end private def respond_with_collection(response) collection_klass = Myfinance::Entities.const_get("#{entity_klass_name}Collection") collection_klass.build(response) end def respond_with_object(response, key) entity_klass = Myfinance::Entities.const_get(entity_klass_name) entity_klass.new(response.parsed_body(key)) end def entity_klass_name self.class.to_s.gsub('Resources', 'Entities') end end end end
Version data entries
12 entries across 12 versions & 1 rubygems