Class: Top4R::Shop

Inherits:
Object
  • Object
show all
Includes:
ModelMixin
Defined in:
lib/top4r/model/shop.rb

Overview

Shop Model

Constant Summary collapse

@@ATTRIBUTES =
[:id, :sid, :cid, :nick, :title, :desc, :bulletin, :pic_path, :created, :modified, :shop_score, :remain_count]

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModelMixin

included

Class Method Details

.attributesObject



42
# File 'lib/top4r/model/shop.rb', line 42

def attributes; @@ATTRIBUTES; end

.default_public_fieldsObject



44
45
46
# File 'lib/top4r/model/shop.rb', line 44

def default_public_fields
  ["sid", "cid", "title", "nick", "desc", "bulletin", "pic_path", "created", "modified"]
end

Instance Method Details

#unmarshal_other_attrsObject



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/top4r/model/shop.rb', line 49

def unmarshal_other_attrs
  @id = @sid
  
  if @shop_score && @shop_score.size > 0
    @shop_score = ShopScore.new(@shop_score)
  else
    @shop_score = nil
  end
  
  self
end