Sha256: 9765c1d62fba72e7333e0bf37404ea867d2204f28c00f1b3aff1dffc081e70e1

Contents?: true

Size: 694 Bytes

Versions: 7

Compression:

Stored size: 694 Bytes

Contents

module Ravelry

  # The API endpoint for fetching `ColorFamilies` can be found in {Ravelry::Misc}.
  #
  # A `ColorFamily` object can be created by several different endpoints but is currently only implemented in {Ravelry::Misc}.
  #
  class ColorFamily
    attr_reader :id, :name, :permalink, :spectrum_order, :color

    # Creates new `ColorFamily` from Ravelry API ColorFamily attributes.
    #
    # All class variables are readonly.
    #
    def initialize(color_family)
      @id = color_family[:id]
      @color = color_family[:color]
      @permalink = color_family[:permalink]
      @name = color_family[:name]
      @spectrum_order = color_family[:spectrum_order]
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ravelry-0.2.0 lib/ravelry/color_family.rb
ravelry-0.1.0 lib/ravelry/color_family.rb
ravelry-0.0.9 lib/ravelry/color_family.rb
ravelry-0.0.8 lib/ravelry/color_family.rb
ravelry-0.0.7 lib/ravelry/color_family.rb
ravelry-0.0.6 lib/ravelry/color_family.rb
ravelry-0.0.5 lib/ravelry/color_family.rb