instance method fetch

Ruby on Rails edge

Since edge

Signature

fetch(column)

No documentation comment.

Parameters

column req
Source
# File activemodel/lib/active_model/indexed_row.rb, line 173
      def fetch(column)
        if index = @indexes[column]
          value = @row[index]
          if UNSET.equal?(value)
            if block_given?
              yield
            else
              raise KeyError, "key not found: #{column.inspect}"
            end
          else
            value
          end
        elsif block_given?
          yield
        else
          raise KeyError, "key not found: #{column.inspect}"
        end
      end

Defined in activemodel/lib/active_model/indexed_row.rb line 173 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::IndexedRow::Mutable

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close