# frozen_string_literal: true module PhoneSites class Base def initialize(data) parseable_fields.each do |name| public_send("#{name}=", parse(data, name)) end end def parse(_, _) raise NotImplementedError end def self.parseable_attributes(*names) names.each { |name| attr_accessor name } define_method("parseable_fields") { names } end end end