Sha256: ef7a13ea794caa428b29601c500b9abbc14aacf103aa87e819326e9e55441a12

Contents?: true

Size: 936 Bytes

Versions: 10

Compression:

Stored size: 936 Bytes

Contents

module Ravelry

  # 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.
  #
  class PatternType

    attr_reader :permalink, :name

    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

    # Boolean value; determins if category qualifies as clothing.
    def clothing?
      @type[:clothing]
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ravelry-0.2.0 lib/ravelry/pattern_type.rb
ravelry-0.1.0 lib/ravelry/pattern_type.rb
ravelry-0.0.9 lib/ravelry/pattern_type.rb
ravelry-0.0.8 lib/ravelry/pattern_type.rb
ravelry-0.0.7 lib/ravelry/pattern_type.rb
ravelry-0.0.6 lib/ravelry/pattern_type.rb
ravelry-0.0.5 lib/ravelry/pattern_type.rb
ravelry-0.0.4 lib/ravelry/pattern_type.rb
ravelry-0.0.2 lib/ravelry/pattern_type.rb
ravelry-0.0.1 lib/ravelry/pattern_type.rb