Class: EdinetCode::Reader::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/edinet_code/reader.rb

Constant Summary collapse

PROPERTIES =
[:edinet_code, :kind, :listed, :consolidated, :capital, :settling_day,
:submitter, :submitter_en, :submitter_kana, :location, :category, :code]

Instance Method Summary collapse

Constructor Details

#initialize(attr = {}) ⇒ Result

Returns a new instance of Result.



13
14
15
16
17
18
19
20
# File 'lib/edinet_code/reader.rb', line 13

def initialize(attr={})
  attr.each do |key, value|
    unless PROPERTIES.include?(key)
      raise PropertyError, "#{key}: プロパティに存在しない名前です"
    end
    instance_variable_set("@#{key.to_s}", value)
  end
end