Class: Revealize::DeckList
- Inherits:
-
Object
- Object
- Revealize::DeckList
- Defined in:
- lib/revealize/deck_list.rb
Instance Attribute Summary collapse
-
#deck_names ⇒ Object
readonly
Returns the value of attribute deck_names.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(*deck_names) ⇒ DeckList
constructor
A new instance of DeckList.
- #render ⇒ Object
- #to_s ⇒ Object
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_names ⇒ Object (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 |
#render ⇒ Object
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_s ⇒ Object
15 16 17 |
# File 'lib/revealize/deck_list.rb', line 15 def to_s "DeckList(#{deck_names.join(', ')})" end |