Sha256: 1d779f9e0d7328c90feb507bd85985fd3007fa989587abcf9f532af0d2382ef4

Contents?: true

Size: 950 Bytes

Versions: 87

Compression:

Stored size: 950 Bytes

Contents

module BELParser
  module Resource
    # Reader represents the API for a reader of resource data.
    module Reader
      def self.assert_reader(reader, var_name)
        return unless reader
        not_impl_methods =
          Reader.instance_methods.reject do |method|
            reader.respond_to?(method)
          end
        unless not_impl_methods.empty?
          raise(
            ArgumentError,
            "#{var_name} does not respond to #{not_impl_methods.join(', ')}.")
        end
      end

      def retrieve_resource(resource_identifier)
        raise NotImplementedError, "#{__method__} is not implemented."
      end

      def retrieve_value_from_resource(resource_identifier, value)
        raise NotImplementedError, "#{__method__} is not implemented."
      end

      def retrieve_values_from_resource(resource_identifier)
        raise NotImplementedError, "#{__method__} is not implemented."
      end
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
bel_parser-1.0.0.alpha.56 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.55-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.55 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.54-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.54 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.53-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.53 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.52-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.52 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.51-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.51 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.50-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.50 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.49-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.49 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.48-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.48 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.47-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.47 lib/bel_parser/resource/reader.rb
bel_parser-1.0.0.alpha.46-java lib/bel_parser/resource/reader.rb