Class: RailsClafer::Card
- Inherits:
-
Object
- Object
- RailsClafer::Card
- Defined in:
- lib/rails_clafer/card.rb
Instance Attribute Summary collapse
-
#max ⇒ Object
Returns the value of attribute max.
-
#min ⇒ Object
Returns the value of attribute min.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(min = 1, max = 1) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(min = 1, max = 1) ⇒ Card
Returns a new instance of Card.
13 14 15 |
# File 'lib/rails_clafer/card.rb', line 13 def initialize(min=1,max=1) @min, @max = min, max end |
Instance Attribute Details
#max ⇒ Object
Returns the value of attribute max.
12 13 14 |
# File 'lib/rails_clafer/card.rb', line 12 def max @max end |
#min ⇒ Object
Returns the value of attribute min.
12 13 14 |
# File 'lib/rails_clafer/card.rb', line 12 def min @min end |
Class Method Details
.from_ar_assoc(assoc) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/rails_clafer/card.rb', line 4 def from_ar_assoc(assoc) if assoc.collection? new 0, "*" else new 1, 1 end end |