Class: Ravelry::Yarn

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

Overview

The information used to create ‘Ravelry::Yarn` currently comes from Pattern objects.

See Pattern for more information about ‘Pattern` objects.

This class will be updated in future to perform GET, POST, PUT, and DESTROY requests.

Instance Attribute Summary

Attributes inherited from Data

#data, #id

Instance Method Summary collapse

Methods inherited from Data

#initialize

Constructor Details

This class inherits a constructor from Ravelry::Data

Instance Method Details

#buildObject



11
# File 'lib/ravelry/yarn.rb', line 11

def build; end

#companyObject

Gets yarn company from existing ‘data`.



19
20
21
# File 'lib/ravelry/yarn.rb', line 19

def company
  data[:yarn_company_name]
end

#company_idObject

Gets yarn company_id from existing ‘data`.



29
30
31
# File 'lib/ravelry/yarn.rb', line 29

def company_id
  data[:yarn_company_id]
end

#fetch_and_parseObject

Handles API call and parses JSON response.



34
35
36
# File 'lib/ravelry/yarn.rb', line 34

def fetch_and_parse
  # TODO
end

#nameObject

Gets yarn name from existing ‘data`.



24
25
26
# File 'lib/ravelry/yarn.rb', line 24

def name
  data[:name]
end

Gets yarn permalink from existing ‘data`.



14
15
16
# File 'lib/ravelry/yarn.rb', line 14

def permalink
  data[:permalink]
end