Sha256: 3efc9c931ce66a38fe305fda8cc1459b6361f42d74923ccb37a83407f298a9b6

Contents?: true

Size: 280 Bytes

Versions: 4

Compression:

Stored size: 280 Bytes

Contents

class Wordsmith::TemplateCollection

  def initialize(templates)
    @templates = templates
  end

  def find(slug)
    template = @templates.find {|t| t.slug == slug }
    template or fail %Q(Template not found with slug: "#{slug}")
  end

  def all
    @templates.dup
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wordsmith-ruby-sdk-1.0.5 lib/wordsmith/template_collection.rb
wordsmith-ruby-sdk-1.0.4 lib/wordsmith/template_collection.rb
wordsmith-ruby-sdk-1.0.3 lib/wordsmith/template_collection.rb
wordsmith-ruby-sdk-1.0.2 lib/wordsmith/template_collection.rb