class GoogleDrive::ListRow

Hash-like object returned by GoogleDrive::List#[].

Public Class Methods

new(list, index) click to toggle source

@api private

# File lib/google_drive/list_row.rb, line 22
def initialize(list, index)
  @list = list
  @index = index
end

Public Instance Methods

==(other) click to toggle source
# File lib/google_drive/list_row.rb, line 78
def ==(other)
  self.class == other.class && to_hash == other.to_hash
end
Also aliased as: ===, eql?
===(other)
Alias for: ==
[](key) click to toggle source
# File lib/google_drive/list_row.rb, line 27
def [](key)
  @list.get(@index, key)
end
[]=(key, value) click to toggle source
# File lib/google_drive/list_row.rb, line 39
def []=(key, value)
  @list.set(@index, key, value)
end
clear() click to toggle source
# File lib/google_drive/list_row.rb, line 64
def clear
  @list.keys.each do |key|
    self[key] = ''
  end
end
eql?(other)
Alias for: ==
has_key?(key) click to toggle source
# File lib/google_drive/list_row.rb, line 43
def has_key?(key)
  @list.keys.include?(key)
end
Also aliased as: include?, key?, member?
include?(key)
Alias for: has_key?
input_value(key) click to toggle source
# File lib/google_drive/list_row.rb, line 35
def input_value(key)
  @list.input_value(@index, key)
end
inspect() click to toggle source
# File lib/google_drive/list_row.rb, line 85
def inspect
  format("\#<%p %p>", self.class, to_hash)
end
key?(key)
Alias for: has_key?
member?(key)
Alias for: has_key?
merge!(hash)
Alias for: update
numeric_value(key) click to toggle source
# File lib/google_drive/list_row.rb, line 31
def numeric_value(key)
  @list.numeric_value(@index, key)
end
replace(hash) click to toggle source
# File lib/google_drive/list_row.rb, line 59
def replace(hash)
  clear
  update(hash)
end
to_hash() click to toggle source
# File lib/google_drive/list_row.rb, line 70
def to_hash
  result = {}
  @list.keys.each do |key|
    result[key] = self[key]
  end
  result
end
update(hash) click to toggle source
# File lib/google_drive/list_row.rb, line 51
def update(hash)
  hash.each do |k, v|
    self[k] = v
  end
end
Also aliased as: merge!