Class: Ravelry::Printing
- Inherits:
-
Object
- Object
- Ravelry::Printing
- Defined in:
- lib/ravelry/printing.rb
Overview
Instance Attribute Summary collapse
-
#amazon_rating ⇒ Object
readonly
Returns the value of attribute amazon_rating.
-
#amazon_url ⇒ Object
readonly
Returns the value of attribute amazon_url.
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#list_price ⇒ Object
readonly
Returns the value of attribute list_price.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pattern_count ⇒ Object
readonly
Returns the value of attribute pattern_count.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#shelf_image_path ⇒ Object
readonly
Returns the value of attribute shelf_image_path.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(printing) ⇒ Printing
constructor
A new instance of Printing.
-
#out_of_print? ⇒ Boolean
Boolean value.
-
#primary_source? ⇒ Boolean
Boolean value.
Constructor Details
#initialize(printing) ⇒ Printing
Returns a new instance of Printing.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ravelry/printing.rb', line 13 def initialize(printing) @printing = printing @pattern_source = printing[:pattern_source] # Price of the printing source. # @price = @pattern_source[:price] # Permalink for printing. # @permalink = @pattern_source[:permalink] # Name of the printing. # @name = @pattern_source[:name] # Author of the printed source (if any). # @author = @pattern_source[:author] # URL of the printing. # @url = @pattern_source[:url] # Printing's rating on Amazon. # @amazon_rating = @pattern_source[:amazon_rating] # Number of patterns available in this printing. # @pattern_count = @pattern_source[:pattern_count] # Printing's Amazon URL. # @amazon_url = @pattern_source[:amazon_url] # Path to image, if any. # @shelf_image_path = @pattern_source[:shelf_image_path] # List price of the printing. # @list_price = @pattern_source[:list_price] end |
Instance Attribute Details
#amazon_rating ⇒ Object (readonly)
Returns the value of attribute amazon_rating.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def @amazon_rating end |
#amazon_url ⇒ Object (readonly)
Returns the value of attribute amazon_url.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def amazon_url @amazon_url end |
#author ⇒ Object (readonly)
Returns the value of attribute author.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def @author end |
#list_price ⇒ Object (readonly)
Returns the value of attribute list_price.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def list_price @list_price end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def name @name end |
#pattern_count ⇒ Object (readonly)
Returns the value of attribute pattern_count.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def pattern_count @pattern_count end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def permalink @permalink end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def price @price end |
#shelf_image_path ⇒ Object (readonly)
Returns the value of attribute shelf_image_path.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def shelf_image_path @shelf_image_path end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
11 12 13 |
# File 'lib/ravelry/printing.rb', line 11 def url @url end |
Instance Method Details
#out_of_print? ⇒ Boolean
Boolean value. Is this resource out of print?
60 61 62 |
# File 'lib/ravelry/printing.rb', line 60 def out_of_print? @pattern_source[:out_of_print] end |
#primary_source? ⇒ Boolean
Boolean value. Is this the primary source of the pattern?
66 67 68 |
# File 'lib/ravelry/printing.rb', line 66 def primary_source? @printing[:primary_source] end |