class Ravelry::PatternType

The information used to create `Ravelry::PatternType` objects comes from {Ravelry::Pattern} objects.

See {Ravelry::Pattern} for more information about `Pattern` objects.

You should not create `PatternType` objects manually; they are all created–and owned–by a {Ravelry::Pattern}.

Note that there are other API endpoints for pattern categorization; this might not be the one that you're looking for.

See {Ravelry::Pattern} for more information about `Pattern` objects.

Attributes

name[R]

Public Class Methods

new(type) click to toggle source
# File lib/ravelry/pattern_type.rb, line 17
def initialize(type)
  @type = type

  # Ravelry vanity permalink for the type. Note: not a full URL.
  #
  @permalink = type[:permalink]

  # Name of the type.
  #
  @name = type[:name]
end

Public Instance Methods

clothing?() click to toggle source

Boolean value; determins if category qualifies as clothing.

# File lib/ravelry/pattern_type.rb, line 30
def clothing?
  @type[:clothing]
end