Module: ProjectStore::Entity::PropertyBinder

Included in:
CommonProperties, MandatoryProperties
Defined in:
lib/project_store/entity/properties_binder.rb

Instance Method Summary collapse

Instance Method Details

#yaml_accessor(*args) ⇒ Object



6
7
8
9
10
11
# File 'lib/project_store/entity/properties_binder.rb', line 6

def yaml_accessor(*args)
  args.each do |arg|
    yaml_reader arg
    yaml_writer arg
  end
end

#yaml_reader(*args) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/project_store/entity/properties_binder.rb', line 13

def yaml_reader(*args)
  args.each do |arg|
    self.class_eval do
      define_method arg do
        self[arg]
      end
    end
  end
end

#yaml_writer(*args) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/project_store/entity/properties_binder.rb', line 23

def yaml_writer(*args)
  args.each do |arg|
    self.class_eval do
      define_method "#{arg}=" do |val|
        self[arg] = val
      end
    end
  end
end