Class: Wonderfl::CodeForks
- Inherits:
-
Object
- Object
- Wonderfl::CodeForks
- Defined in:
- lib/wonderfl/code_forks.rb
Instance Attribute Summary collapse
-
#code_list ⇒ Object
readonly
Returns the value of attribute code_list.
Instance Method Summary collapse
- #count ⇒ Object
- #each ⇒ Object
-
#initialize(payload) ⇒ CodeForks
constructor
A new instance of CodeForks.
Constructor Details
#initialize(payload) ⇒ CodeForks
Returns a new instance of CodeForks.
4 5 6 7 8 |
# File 'lib/wonderfl/code_forks.rb', line 4 def initialize(payload) raise TypeError, 'Array argument expected' unless payload.is_a? Array @code_list = [] payload.each { |code| @code_list << Wonderfl::Code.new(code) } end |
Instance Attribute Details
#code_list ⇒ Object (readonly)
Returns the value of attribute code_list.
2 3 4 |
# File 'lib/wonderfl/code_forks.rb', line 2 def code_list @code_list end |
Instance Method Details
#count ⇒ Object
14 15 16 |
# File 'lib/wonderfl/code_forks.rb', line 14 def count @code_list.length end |
#each ⇒ Object
10 11 12 |
# File 'lib/wonderfl/code_forks.rb', line 10 def each @code_list.each { |code| yield code } end |