class OpenStruct

Public Instance Methods

as_json(table: true)
Alias for: to_json
attributes() click to toggle source
# File lib/lite/ruby/open_struct.rb, line 7
def attributes
  @table
end
replace(args) click to toggle source
# File lib/lite/ruby/open_struct.rb, line 11
def replace(args)
  args.each { |key, val| self[key] = val }
end
to_h(table: true)
Alias for: to_hash
to_hash(table: true) click to toggle source
# File lib/lite/ruby/open_struct.rb, line 15
def to_hash(table: true)
  return attributes unless table

  { table: attributes }
end
Also aliased as: to_h
to_json(table: true) click to toggle source
# File lib/lite/ruby/open_struct.rb, line 21
def to_json(table: true)
  to_hash(table: table).to_json
end
Also aliased as: as_json