lib/ronin/url_scheme.rb in ronin-1.0.0.rc1 vs lib/ronin/url_scheme.rb in ronin-1.0.0.rc2

- old
+ new

@@ -18,22 +18,36 @@ # require 'ronin/model' require 'ronin/model/has_unique_name' +require 'dm-is-predefined' + module Ronin # # Represents a {URL} scheme. # class URLScheme include Model include Model::HasUniqueName + + is :predefined # primary key of the URL Scheme property :id, Serial # The URLs that use the scheme - has 1..n, :urls, :model => 'URL' + has 0..n, :urls, :model => 'URL', + :child_key => [:scheme_id] + + # Predefines the HTTP URL Scheme + predefine :http, :name => 'http' + + # Predefines the HTTPS URL Scheme + predefine :https, :name => 'https' + + # Predefines the FTP URL Scheme + predefine :ftp, :name => 'ftp' end end