Sha256: d624f6e3c07d140cc1f0ee6b0b2a191c8949b920eb022f0b393f036dd6ed64ec
Contents?: true
Size: 820 Bytes
Versions: 2
Compression:
Stored size: 820 Bytes
Contents
module Ravelry # Handles API request for the `Misc` endpoints. Always returns an array of objects. # module Misc extend self # Handles GET API call and parses JSON response for the `Misc#color_families` Ravelry endpoint. # # Returns an array of {Ravelry::ColorFamily} objects. # def color_families result = Utils::Request.get("color_families.json", :color_families) result.map { |color_family| ColorFamily.new(color_family) } end # Handles GET API call and parses JSON response for the `Misc#color_families` Ravelry endpoint. # # Returns an array of {Ravelry::ColorFamily} objects. # def yarn_weights result = Utils::Request.get("yarn_weights.json", :yarn_weights) result.map { |yarn_weight| YarnWeight.new(yarn_weight) } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ravelry-0.0.7 | lib/ravelry/misc.rb |
ravelry-0.0.6 | lib/ravelry/misc.rb |