Class: Blockhead::Extractors::Enumerable

Inherits:
Abstract
  • Object
show all
Defined in:
lib/blockhead/extractors/enumerable.rb

Instance Attribute Summary

Attributes inherited from Abstract

#next, #object

Instance Method Summary collapse

Methods inherited from Abstract

#extract, #initialize

Constructor Details

This class inherits a constructor from Blockhead::Extractors::Abstract

Instance Method Details

#extract_valueObject



8
9
10
# File 'lib/blockhead/extractors/enumerable.rb', line 8

def extract_value
  object.map { |obj| Block.new(obj, [], @proc).extract_value }
end

#valid?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/blockhead/extractors/enumerable.rb', line 4

def valid?
  @proc && safe_enumerable?
end