Method: SwotCollectionMethods#each_domain
- Defined in:
- lib/swot/collection_methods.rb
#each_domain ⇒ Object
Yields a Swot instance for every domain under lib/domains. Does not
include blacklisted or ACADEMIC_TLDS domains.
returns a Enumerator object with Swot instances if no block is given
14 15 16 17 18 19 |
# File 'lib/swot/collection_methods.rb', line 14 def each_domain return to_enum(:each_domain) unless block_given? Pathname.glob(Pathname.new(Swot.domains_path).join('**/*.txt')) do |path| yield(Swot.from_path(path)) end end |