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.
344 345 346 347 348 349 350 351 352 |
# File 'lib/ruic/assets.rb', line 344 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.
343 344 345 |
# File 'lib/ruic/assets.rb', line 343 def length @length end |
Instance Method Details
#[](index_or_name) ⇒ Object
356 357 358 |
# File 'lib/ruic/assets.rb', line 356 def [](index_or_name) @lookup[ index_or_name ] end |
#each ⇒ Object
353 354 355 |
# File 'lib/ruic/assets.rb', line 353 def each @slides.each{ |s| yield(s) } end |
#inspect ⇒ Object
359 360 361 |
# File 'lib/ruic/assets.rb', line 359 def inspect "[ #{@slides.map(&:inspect).join ', '} ]" end |
#to_ary ⇒ Object
362 363 364 |
# File 'lib/ruic/assets.rb', line 362 def to_ary @slides end |