class MetaHari::Product

Attributes

description[R]
image[R]
name[R]
uri[R]

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/meta_hari/product.rb, line 8
def initialize(attributes = {})
  apply attributes
end

Public Instance Methods

apply(attributes) click to toggle source
# File lib/meta_hari/product.rb, line 12
def apply(attributes)
  @uri         = attributes['uri']          if uri.nil?
  @name        = attributes['name']         if blank? name
  @image       = attributes['image']        if blank? image
  @description = attributes['description']  if blank? description
  self
end

Private Instance Methods

blank?(value) click to toggle source
# File lib/meta_hari/product.rb, line 22
def blank?(value)
  value.nil? || value.empty?
end