Class: NerdTown::Guild::MemberCollectionParser::MemberCollection
- Inherits:
-
Object
- Object
- NerdTown::Guild::MemberCollectionParser::MemberCollection
- Includes:
- Enumerable
- Defined in:
- lib/nerd_town/guild.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize ⇒ MemberCollection
constructor
A new instance of MemberCollection.
- #push(member) ⇒ Object
Constructor Details
#initialize ⇒ MemberCollection
Returns a new instance of MemberCollection.
78 79 80 |
# File 'lib/nerd_town/guild.rb', line 78 def initialize @collection = [] end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
76 77 78 |
# File 'lib/nerd_town/guild.rb', line 76 def collection @collection end |
Instance Method Details
#each(&block) ⇒ Object
82 83 84 85 86 |
# File 'lib/nerd_town/guild.rb', line 82 def each(&block) collection.each do |member| block.call(member) end end |
#push(member) ⇒ Object
88 89 90 |
# File 'lib/nerd_town/guild.rb', line 88 def push(member) collection.push(member) end |