notes.org

Summary

Maintainability
Test Coverage
0.4

* DONE Get rid of profile/rel registry, use policy instead
* DONE pass around policy explicitly instead of through options
* DONE introduce name/type separate from profile
** DONE mapper
** DONE Resource
* DONE allow setting rel types directly on associations, with fallback to policy
* DONE switch to hash-based init of Resource to make it more extensible
* DONE add Resource#type
* DONE not 100% happy yet about nameing of mapper#mapper_name / config#name. Maybe use `type` across the board?
* DONE Fix JsonAPISerializer
* top-level automatic links, e.g. for self and profile
* make HAL plural/singular links configurable from the Yaks.new
* make primitivize configuration instance based, not global
* Have JsonApi add self links as href: attributes
* Move examples to acceptance tests
* Select mapper based on content type
* move to 100% mutcov

pre 0.5

* CURIES/namespaces

Ticketsolve::Api::Yaks = ::Yaks.new do
  policy do
    def derive...
  end

  hal_options.plural_link '...'

  primitivize Date, Time do |o|
    o.iso8601
  end

  rel_template "http://literature.example.com/rel/#{association_name}"

  link :self, "http://api.com/{key}/{id}"
  link :profile, "http://api.com/profile/{key}"

  # and/or
  derive_rel_from_association do |mapper, association|
    "http://literature.example.com/rel/#{association.name}"
  end
end



* DONE 59 lib/yaks/mapper.rb
* DONE 92 lib/yaks/mapper/link.rb
* DONE 37 lib/yaks/mapper/association.rb
* DONE 3 lib/yaks/version.rb
* DONE 13 lib/yaks/mapper/has_many.rb
* DONE 9 lib/yaks/mapper/has_one.rb
* DONE 79 lib/yaks/config.rb
*   79 lib/yaks/mapper/config.rb
*   73 lib/yaks.rb
* DONE 72 lib/yaks/util.rb
* DONE 65 lib/yaks/collection_resource.rb
*   59 lib/yaks/json_api_serializer.rb
*   59 lib/yaks/hal_serializer.rb
*   43 lib/yaks/primitivize.rb
*   37 lib/yaks/mapper/class_methods.rb
* DONE 33 lib/yaks/collection_mapper.rb
*   28 lib/yaks/null_resource.rb
* DONE 27 lib/yaks/resource.rb
*   25 lib/yaks/resource/link.rb
* DONE 23 lib/yaks/fp.rb
*   22 lib/yaks/serializer.rb
*   15 lib/yaks/shared_options.rb
*   15 lib/yaks/default_policy.rb
*   10 lib/yaks/mapper/map_links.rb

http://www.dragoart.com/tuts/4344/1/1/how-to-draw-a-yak.htm
https://www.google.com/search?q=yak+head&num=20&source=lnms&tbm=isch&sa=X&ei=uVoAVbyWLcTiO-v0gYgF&ved=0CAcQ_AUoAQ&biw=1758&bih=923&dpr=1.09#imgdii=_&imgrc=CtgMobmQThXw_M%253A%3BzyYGcwgq1IAU_M%3Bhttps%253A%252F%252Fcallaocafeandmarket.files.wordpress.com%252F2014%252F02%252Fyak2.jpg%3Bhttps%253A%252F%252Fcallaocafeandmarket.wordpress.com%252Fweather%252F%3B563%3B539
https://www.google.com/search?q=hair+over+eyes&num=20&source=lnms&tbm=isch&sa=X&ei=p2sBVajOOIKvPdDjgPgL&ved=0CAcQ_AUoAQ&biw=1758&bih=923&dpr=1.09#imgdii=_&imgrc=la9hTGBvOniv9M%253A%3B_nu4vLbBOXzIeM%3Bhttp%253A%252F%252Fwww.rampantscotland.com%252Fdiary%252Fgraphics%252Fhighland_cow_baldernock_x3481d.jpg%3Bhttp%253A%252F%252Fwww.rampantscotland.com%252Fdiary%252Fdiary_photos_july11b.htm%3B514%3B496
https://www.google.com/search?q=hair+over+eyes&num=20&source=lnms&tbm=isch&sa=X&ei=p2sBVajOOIKvPdDjgPgL&ved=0CAcQ_AUoAQ&biw=1758&bih=923&dpr=1.09#imgdii=_&imgrc=RmzHL5NICZcanM%253A%3BwMr__Up6S7s_9M%3Bhttp%253A%252F%252Fwww.peakdistrictonline.co.uk%252Fimages%252Fwildlife%252Fanimals%252FHighland_Cattle_In_The_Peak_District_5.jpg%3Bhttp%253A%252F%252Fwww.peakdistrictonline.co.uk%252Ffarm-animals-highland-cattle-c101118.html%3B620%3B412
https://www.google.com/search?biw=1758&bih=923&tbm=isch&sa=1&q=yak+horns&oq=yak+horns&gs_l=img.3..0j0i24.118958.120138.0.120293.9.8.0.1.1.0.142.713.6j2.8.0.msedr...0...1c.1.62.img..0.9.701.rHB0v54VT9k#imgdii=_&imgrc=c8D4U_x1gob0YM%253A%3BzvdhmtL1g8r_UM%3Bhttp%253A%252F%252F4.bp.blogspot.com%252F_2Sr5OicZPHQ%252FTFT2H5ViKWI%252FAAAAAAAAAFs%252FfYlG-en9mFk%252Fs1600%252Fyak%252Band%252BDri.jpg%3Bhttp%253A%252F%252Fthewodakpa.blogspot.com%252F2010%252F07%252Ftibetan-yak_29.html%3B1080%3B672
https://www.google.com/search?biw=1758&bih=923&tbm=isch&sa=1&q=yak+horns&oq=yak+horns&gs_l=img.3..0j0i24.118958.120138.0.120293.9.8.0.1.1.0.142.713.6j2.8.0.msedr...0...1c.1.62.img..0.9.701.rHB0v54VT9k#imgdii=_&imgrc=_N83z2DYkcc7DM%253A%3BDV8K7BLZksSGrM%3Bhttp%253A%252F%252Fthumbs.dreamstime.com%252Fz%252Fyak-stuffed-animal-like-bull-23182676.jpg%3Bhttp%253A%252F%252Fwww.dreamstime.com%252Froyalty-free-stock-image-yak-stuffed-animal-like-bull-image23182676%3B1300%3B957


* JSON-LD / RDF
** Useful protocols used in RDF.rb

   - to_rdf, to_uri
   - RDF::URI pname, qname
   - RDF::Vocabulary::Term

http://ruby-rdf.github.io/
https://github.com/ruby-rdf/json-ld/
http://schema.org/MusicEvent
https://developers.google.com/structured-data/events/venues
http://json-ld.org/playground/index.html


    http://www.iana.org/assignments/relation/
    http://microformats.org/wiki/rel- and http://microformats.org/profile/