Method: Useless::Doc::Serialization::Load.domain
- Defined in:
- lib/useless/doc/serialization/load.rb
.domain(json) ⇒ Core::Domain
Converts a JSON represntation to an instance of Core::Domain
| 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | # File 'lib/useless/doc/serialization/load.rb', line 48 def self.domain(json) hash = json_to_hash json apis = (hash['apis'] || []).map do |json| api json end = begin Time.parse(hash['timestamp']) rescue TypeError, ArgumentError nil end Useless::Doc::Core::Domain.new \ name: hash['name'], url: hash['url'], timestamp: , description: hash['description'], apis: apis end |