Class: UIC::SlideCollection
- Inherits:
-
Object
- Object
- UIC::SlideCollection
- Includes:
- Enumerable
- Defined in:
- lib/ruic/assets.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Instance Method Summary collapse
- #[](index_or_name) ⇒ Object
- #each ⇒ Object
-
#initialize(slides) ⇒ SlideCollection
constructor
A new instance of SlideCollection.
- #inspect ⇒ Object
- #to_ary ⇒ Object
Constructor Details
#initialize(slides) ⇒ SlideCollection
Returns a new instance of SlideCollection.
363 364 365 366 367 368 369 370 371 |
# File 'lib/ruic/assets.rb', line 363 def initialize() @length = .length-1 @slides = @lookup = {} .each do |s| @lookup[s.index] = s @lookup[s.name] = s end end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
362 363 364 |
# File 'lib/ruic/assets.rb', line 362 def length @length end |
Instance Method Details
#[](index_or_name) ⇒ Object
375 376 377 |
# File 'lib/ruic/assets.rb', line 375 def [](index_or_name) @lookup[ index_or_name ] end |
#each ⇒ Object
372 373 374 |
# File 'lib/ruic/assets.rb', line 372 def each @slides.each{ |s| yield(s) } end |
#inspect ⇒ Object
378 379 380 |
# File 'lib/ruic/assets.rb', line 378 def inspect "[ #{@slides.map(&:inspect).join ', '} ]" end |
#to_ary ⇒ Object
381 382 383 |
# File 'lib/ruic/assets.rb', line 381 def to_ary @slides end |