Sha256: fa0278d67b47fd90c2a8dbfb4c698cd86786fdb909fbea49737cdcc83b8702d2
Contents?: true
Size: 465 Bytes
Versions: 3
Compression:
Stored size: 465 Bytes
Contents
module Livefyre class NetworkValidator def self.validate(data) reason = '' if data.name.to_s.empty? reason += '\n Name is null or blank' elsif !data.name.to_s.end_with? 'fyre.co' reason += "\n Name must end with 'fyre.co'" end reason += '\n Key is null or blank' if data.key.to_s.empty? raise ArgumentError, "Problems with your network input: #{reason}" if reason.length > 0 data end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
livefyre-2.0.2 | lib/livefyre/validator/network_validator.rb |
livefyre-2.0.1 | lib/livefyre/validator/network_validator.rb |
livefyre-2.0.0 | lib/livefyre/validator/network_validator.rb |