Class: Dmm::Item

Inherits:
Base
  • Object
show all
Defined in:
lib/dmm/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attr_reader, #initialize

Constructor Details

This class inherits a constructor from Dmm::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method) ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/dmm/item.rb', line 42

def method_missing(method)
  if iteminfo.respond_to? method.to_sym
    iteminfo.send(method.to_sym)
  elsif prices.respond_to? method.to_sym
    prices.send(method.to_sym)
  else
    super
  end
end

Instance Attribute Details

#affiliateURLObject (readonly) Also known as: affiliate_url

Returns the value of attribute affiliateURL.



7
8
9
# File 'lib/dmm/item.rb', line 7

def affiliateURL
  @affiliateURL
end

#affiliateURLspObject (readonly) Also known as: affiliate_url_sp

Returns the value of attribute affiliateURLsp.



7
8
9
# File 'lib/dmm/item.rb', line 7

def affiliateURLsp
  @affiliateURLsp
end

#category_nameObject (readonly)

Returns the value of attribute category_name.



7
8
9
# File 'lib/dmm/item.rb', line 7

def category_name
  @category_name
end

#content_idObject (readonly)

Returns the value of attribute content_id.



7
8
9
# File 'lib/dmm/item.rb', line 7

def content_id
  @content_id
end

#dateObject (readonly)

Returns the value of attribute date.



7
8
9
# File 'lib/dmm/item.rb', line 7

def date
  @date
end

#floor_nameObject (readonly)

Returns the value of attribute floor_name.



7
8
9
# File 'lib/dmm/item.rb', line 7

def floor_name
  @floor_name
end

#imageURLObject (readonly) Also known as: image_url

Returns the value of attribute imageURL.



7
8
9
# File 'lib/dmm/item.rb', line 7

def imageURL
  @imageURL
end

#isbnObject (readonly)

Returns the value of attribute isbn.



7
8
9
# File 'lib/dmm/item.rb', line 7

def isbn
  @isbn
end

#jancodeObject (readonly)

Returns the value of attribute jancode.



7
8
9
# File 'lib/dmm/item.rb', line 7

def jancode
  @jancode
end

#maker_productObject (readonly)

Returns the value of attribute maker_product.



7
8
9
# File 'lib/dmm/item.rb', line 7

def maker_product
  @maker_product
end

#product_idObject (readonly)

Returns the value of attribute product_id.



7
8
9
# File 'lib/dmm/item.rb', line 7

def product_id
  @product_id
end

#service_nameObject (readonly)

Returns the value of attribute service_name.



7
8
9
# File 'lib/dmm/item.rb', line 7

def service_name
  @service_name
end

#stockObject (readonly)

Returns the value of attribute stock.



7
8
9
# File 'lib/dmm/item.rb', line 7

def stock
  @stock
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/dmm/item.rb', line 7

def title
  @title
end

#URLObject (readonly) Also known as: url

Returns the value of attribute URL.



7
8
9
# File 'lib/dmm/item.rb', line 7

def URL
  @URL
end

#URLspObject (readonly) Also known as: url_sp

Returns the value of attribute URLsp.



7
8
9
# File 'lib/dmm/item.rb', line 7

def URLsp
  @URLsp
end

Instance Method Details

#iteminfoDmm::Iteminfo

Returns a Dmm::Iteminfo object

Returns:



37
38
39
40
# File 'lib/dmm/item.rb', line 37

def iteminfo
  @iteminfo ||= Dmm::Iteminfo.new(@attrs[:iteminfo])
  @iteminfo
end

#pricesDmm::Price

Returns a Dmm::Price object

Returns:



29
30
31
32
# File 'lib/dmm/item.rb', line 29

def prices
  @price ||= Dmm::Price.new(@attrs[:prices])
  @price
end

#respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


53
# File 'lib/dmm/item.rb', line 53

def respond_to?(method, include_private = false); iteminfo.respond_to?(method.to_sym) || price.respond_to?(method.to_sym) || super; end

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


52
# File 'lib/dmm/item.rb', line 52

def respond_to_missing?(method, include_private = false); iteminfo.respond_to?(method.to_sym) || price.respond_to?(method.to_sym) || super; end

#sampleImageURLArray<String> Also known as: sample_image_url

Returns an Array of sampleimage url

Returns:



21
22
23
# File 'lib/dmm/item.rb', line 21

def sampleImageURL
  @attrs[:sampleImageURL][:sample_s][:image]
end