Class: Revealize::DeckList

Inherits:
Object
  • Object
show all
Defined in:
lib/revealize/deck_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*deck_names) ⇒ DeckList

Returns a new instance of DeckList.



4
5
6
# File 'lib/revealize/deck_list.rb', line 4

def initialize(*deck_names)
  @deck_names = deck_names
end

Instance Attribute Details

#deck_namesObject (readonly)

Returns the value of attribute deck_names.



3
4
5
# File 'lib/revealize/deck_list.rb', line 3

def deck_names
  @deck_names
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
14
# File 'lib/revealize/deck_list.rb', line 11

def ==(other)
  return false unless other.is_a?(DeckList)
  return other.deck_names == deck_names
end

#renderObject



8
9
10
# File 'lib/revealize/deck_list.rb', line 8

def render
  deck_names.map {|deck_name| "<a href=\"/#{deck_name}\">#{deck_name}</a>" }.join($/)
end

#to_sObject



15
16
17
# File 'lib/revealize/deck_list.rb', line 15

def to_s
  "DeckList(#{deck_names.join(', ')})"
end