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.
205 206 207 208 209 210 211 212 213 |
# File 'lib/ruic/assets.rb', line 205 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.
204 205 206 |
# File 'lib/ruic/assets.rb', line 204 def length @length end |
Instance Method Details
#[](index_or_name) ⇒ Object
217 218 219 |
# File 'lib/ruic/assets.rb', line 217 def [](index_or_name) @lookup[ index_or_name ] end |
#each ⇒ Object
214 215 216 |
# File 'lib/ruic/assets.rb', line 214 def each @slides.each{ |s| yield(s) } end |
#inspect ⇒ Object
220 221 222 |
# File 'lib/ruic/assets.rb', line 220 def inspect "[ #{@slides.map(&:inspect).join ', '} ]" end |
#to_ary ⇒ Object
223 224 225 |
# File 'lib/ruic/assets.rb', line 223 def to_ary @slides end |