Class: RailsClafer::Card

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_clafer/card.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#maxObject

Returns the value of attribute max.



12
13
14
# File 'lib/rails_clafer/card.rb', line 12

def max
  @max
end

#minObject

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