class GreenMonster::Encoder

Public Class Methods

new(schema) click to toggle source

初期化

# File lib/green_monster/encoder.rb, line 4
def initialize(schema)
  @schema = schema
end

Public Instance Methods

convert(model) click to toggle source

変換

# File lib/green_monster/encoder.rb, line 9
def convert(model)
  @schema.attributes.map do |attr|
    [attr.name, attr.encode(model.send(attr.name)), attr.options[:col_num]]
  end
end