Class: Brutalismbot::S3::Prefix
- Inherits:
-
Object
- Object
- Brutalismbot::S3::Prefix
- Includes:
- Enumerable
- Defined in:
- lib/brutalismbot/s3/prefix.rb
Instance Method Summary collapse
- #all ⇒ Object
- #each ⇒ Object
-
#initialize(prefix, &block) ⇒ Prefix
constructor
A new instance of Prefix.
- #last ⇒ Object
Constructor Details
#initialize(prefix, &block) ⇒ Prefix
Returns a new instance of Prefix.
11 12 13 14 |
# File 'lib/brutalismbot/s3/prefix.rb', line 11 def initialize(prefix, &block) @prefix = prefix @block = block if block_given? end |
Instance Method Details
#all ⇒ Object
22 23 24 |
# File 'lib/brutalismbot/s3/prefix.rb', line 22 def all to_a end |
#each ⇒ Object
16 17 18 19 20 |
# File 'lib/brutalismbot/s3/prefix.rb', line 16 def each @prefix.each do |object| yield @block.nil? ? object : @block.call(object) end end |
#last ⇒ Object
26 27 28 |
# File 'lib/brutalismbot/s3/prefix.rb', line 26 def last to_a.last end |