Class: Trackler::Implementations

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/trackler/implementations.rb

Overview

Implementations is a collection of exercises in a specific language track.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo, slugs, root, track) ⇒ Implementations

Returns a new instance of Implementations.



7
8
9
10
11
12
# File 'lib/trackler/implementations.rb', line 7

def initialize(repo, slugs, root, track)
  @repo = repo
  @slugs = slugs
  @root = root
  @track = track
end

Instance Attribute Details

#repoObject (readonly)

Returns the value of attribute repo.



6
7
8
# File 'lib/trackler/implementations.rb', line 6

def repo
  @repo
end

#rootObject (readonly)

Returns the value of attribute root.



6
7
8
# File 'lib/trackler/implementations.rb', line 6

def root
  @root
end

#slugsObject (readonly)

Returns the value of attribute slugs.



6
7
8
# File 'lib/trackler/implementations.rb', line 6

def slugs
  @slugs
end

#trackObject (readonly)

Returns the value of attribute track.



6
7
8
# File 'lib/trackler/implementations.rb', line 6

def track
  @track
end

Instance Method Details

#[](slug) ⇒ Object



20
21
22
# File 'lib/trackler/implementations.rb', line 20

def [](slug)
  by_slug[slug]
end

#eachObject



14
15
16
17
18
# File 'lib/trackler/implementations.rb', line 14

def each
  all.each do |implementation|
    yield implementation
  end
end

#lengthObject Also known as: size



24
25
26
# File 'lib/trackler/implementations.rb', line 24

def length
  all.length
end