Sha256: 2c629f7bffe3ab3f189c2743e0974583d734fc95c7db7d6307e689ed77499bea
Contents?: true
Size: 649 Bytes
Versions: 35
Compression:
Stored size: 649 Bytes
Contents
# frozen_string_literal: true require "jr/cli/core_ext" module Mihari module Feed class Parser attr_reader :data # # @param [Array<Hash>, Array<Array<String>>] data # def initialize(data) @data = data end # # Parse data by selector # # @param [String] selector # # @return [Array<String>] # def parse(selector) parsed = data.instance_eval(selector) raise FeedParseError unless parsed.is_a?(Array) || parsed.is_a?(Enumerator) raise FeedParseError unless parsed.all?(String) parsed.to_a end end end end
Version data entries
35 entries across 35 versions & 1 rubygems