Class: ErYamlModel

Inherits:
Object
  • Object
show all
Defined in:
lib/yaml2erd/er_yaml_model.rb

Instance Method Summary collapse

Constructor Details

#initialize(yaml_model) ⇒ ErYamlModel

Returns a new instance of ErYamlModel.



2
3
4
5
6
# File 'lib/yaml2erd/er_yaml_model.rb', line 2

def initialize(yaml_model)
  @yaml_model = yaml_model

  parse_columns
end

Instance Method Details

#columnsObject



8
9
10
# File 'lib/yaml2erd/er_yaml_model.rb', line 8

def columns
  @yaml_model[:columns]
end

#descriptionObject



25
26
27
# File 'lib/yaml2erd/er_yaml_model.rb', line 25

def description
  @yaml_model[:description]
end

#group_nameObject



21
22
23
# File 'lib/yaml2erd/er_yaml_model.rb', line 21

def group_name
  @yaml_model[:group]
end

#parsed_columnsObject



12
13
14
# File 'lib/yaml2erd/er_yaml_model.rb', line 12

def parsed_columns
  @yaml_model[:parsed_columns]
end

#relationsObject



16
17
18
19
# File 'lib/yaml2erd/er_yaml_model.rb', line 16

def relations
  # TODO: 同じassociationのtypeまとめる形の方がいいかも yamlの構造を変えるかここで変換するか
  @yaml_model[:relations]
end