Sha256: 14df8ef52a1e13cf74e584878ae17f19efd6d217936735f16ae48795ca65183e
Contents?: true
Size: 754 Bytes
Versions: 2
Compression:
Stored size: 754 Bytes
Contents
require 'thanos/api/client' require 'thanos/response_holder' require 'thanos/factories/series' module Thanos class SeriesFinder ATTRIBUTES = [:name, :modifiedSince, :creators, :characters, :series, :comics, :stories, :orderBy, :limit, :offset] ATTRIBUTES.each do |attribute| parameter = StringActions.parameterize(attribute.to_s) define_method("find_by_#{parameter}") do |attr| find("#{attribute}".to_sym => attr) end end def find(attribute) FinderValidator.validate(attribute, ATTRIBUTES) response = Thanos::API::Client.new.get(:series, attribute) results = Thanos::ResponseHolder.new(response).results Thanos::Factory::Series.new(results).build end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
thanos-0.6.0 | lib/thanos/finders/series_finder.rb |
thanos-0.5.0 | lib/thanos/finders/series_finder.rb |