Class: SGK::Gacha::Result
- Inherits:
-
Object
- Object
- SGK::Gacha::Result
- Defined in:
- lib/sgk/gacha/result.rb
Overview
ガチャ抽選の結果を表す。
Instance Attribute Summary collapse
-
#card ⇒ Object
readonly
Returns the value of attribute card.
Instance Method Summary collapse
-
#initialize(card) ⇒ Result
constructor
A new instance of Result.
-
#json_format ⇒ Object
JSON変換用メソッド.
- #name ⇒ Object
- #rarity ⇒ Object
Constructor Details
#initialize(card) ⇒ Result
Returns a new instance of Result.
10 11 12 |
# File 'lib/sgk/gacha/result.rb', line 10 def initialize(card) @card = card end |
Instance Attribute Details
#card ⇒ Object (readonly)
Returns the value of attribute card.
8 9 10 |
# File 'lib/sgk/gacha/result.rb', line 8 def card @card end |
Instance Method Details
#json_format ⇒ Object
JSON変換用メソッド
23 24 25 26 27 28 29 |
# File 'lib/sgk/gacha/result.rb', line 23 def json_format { card_id: @card.id, name: @card.name, rarity: @card.rarity } end |
#name ⇒ Object
14 15 16 |
# File 'lib/sgk/gacha/result.rb', line 14 def name @card.name end |
#rarity ⇒ Object
18 19 20 |
# File 'lib/sgk/gacha/result.rb', line 18 def rarity @card.rarity end |