Class: Ravelry::ColorFamily

Inherits:
Object
  • Object
show all
Defined in:
lib/ravelry/color_family.rb

Overview

The API endpoint for fetching ‘ColorFamilies` can be found in Misc.

A ‘ColorFamily` object can be created by several different endpoints but is currently only implemented in Misc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(color_family) ⇒ ColorFamily

Creates new ‘ColorFamily` from Ravelry API ColorFamily attributes.

All class variables are readonly.



14
15
16
17
18
19
20
# File 'lib/ravelry/color_family.rb', line 14

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

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



8
9
10
# File 'lib/ravelry/color_family.rb', line 8

def color
  @color
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/ravelry/color_family.rb', line 8

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/ravelry/color_family.rb', line 8

def name
  @name
end

Returns the value of attribute permalink.



8
9
10
# File 'lib/ravelry/color_family.rb', line 8

def permalink
  @permalink
end

#spectrum_orderObject (readonly)

Returns the value of attribute spectrum_order.



8
9
10
# File 'lib/ravelry/color_family.rb', line 8

def spectrum_order
  @spectrum_order
end