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.1.6-java lib/bel_parser/resource/reader.rb
bel_parser-1.1.6 lib/bel_parser/resource/reader.rb
bel_parser-1.1.5 lib/bel_parser/resource/reader.rb
bel_parser-1.1.4-java lib/bel_parser/resource/reader.rb
bel_parser-1.1.4 lib/bel_parser/resource/reader.rb
bel_parser-1.1.3-java lib/bel_parser/resource/reader.rb
bel_parser-1.1.3 lib/bel_parser/resource/reader.rb
bel_parser-1.1.2-java lib/bel_parser/resource/reader.rb
bel_parser-1.1.2 lib/bel_parser/resource/reader.rb
bel_parser-1.1.1-java lib/bel_parser/resource/reader.rb
bel_parser-1.1.1 lib/bel_parser/resource/reader.rb
bel_parser-1.0.8-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.8 lib/bel_parser/resource/reader.rb
bel_parser-1.0.7-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.7 lib/bel_parser/resource/reader.rb
bel_parser-1.0.6-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.6 lib/bel_parser/resource/reader.rb
bel_parser-1.0.5-java lib/bel_parser/resource/reader.rb
bel_parser-1.0.5 lib/bel_parser/resource/reader.rb
bel_parser-1.0.4-java lib/bel_parser/resource/reader.rb