Class: ODDB::SlEntry

Inherits:
Object show all
Includes:
OddbYaml, Persistence
Defined in:
src/model/slentry.rb,
test/test_model/slentry.rb,
ext/export/src/oddb_yaml.rb

Constant Summary

EXPORT_PROPERTIES =
[
  '@bsv_dossier',
  '@introduction_date',
  '@limitation',
  '@limitation_points',
  '@limitation_text',
]

Constants included from OddbYaml

EXPORT_PROPERTIES, YAML_URI

Constants included from Persistence

ODBA_PREDEFINE_SERIALIZABLE

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from OddbYaml

#to_yaml_properties, #to_yaml_type

Methods included from Persistence

#initialize

Methods included from PersistenceMethods

#checkout, #data_origin, #data_origins, #diff, #init, #nil_if_empty, #parent, #structural_ancestors, #undiffable?, #update_values

Constructor Details

This class inherits a constructor from ODDB::Persistence

Instance Attribute Details

- (Object) bsv_dossier

Returns the value of attribute bsv_dossier



12
13
14
# File 'src/model/slentry.rb', line 12

def bsv_dossier
  @bsv_dossier
end

- (Object) introduction_date

Returns the value of attribute introduction_date



12
13
14
# File 'src/model/slentry.rb', line 12

def introduction_date
  @introduction_date
end

- (Object) limitation

Returns the value of attribute limitation



11
12
13
# File 'src/model/slentry.rb', line 11

def limitation
  @limitation
end

- (Object) limitation_points

Returns the value of attribute limitation_points



11
12
13
# File 'src/model/slentry.rb', line 11

def limitation_points
  @limitation_points
end

- (Object) limitation_text (readonly)

Returns the value of attribute limitation_text



14
15
16
# File 'src/model/slentry.rb', line 14

def limitation_text
  @limitation_text
end

- (Object) status

Returns the value of attribute status



12
13
14
# File 'src/model/slentry.rb', line 12

def status
  @status
end

- (Object) type

Returns the value of attribute type



12
13
14
# File 'src/model/slentry.rb', line 12

def type
  @type
end

- (Object) valid_from

Returns the value of attribute valid_from



12
13
14
# File 'src/model/slentry.rb', line 12

def valid_from
  @valid_from
end

- (Object) valid_until

Returns the value of attribute valid_until



12
13
14
# File 'src/model/slentry.rb', line 12

def valid_until
  @valid_until
end

Instance Method Details

- (Object) adjust_types(values, app = nil)



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'src/model/slentry.rb', line 27

def adjust_types(values, app=nil)
  values = values.dup
  values.each { |key, value|
    case(key)
    when :introduction_date
      values[key] = if (value.is_a? Date)
        value
      else
        Date.parse(value.tr('.', '-'))
      end
    when :limitation
      values[key] = ([true, 'true', 'Y'].include? value) ? true : false
    when :limitation_points
      points = value.to_i
      values[key] = (points > 0) ? points : nil
    end unless value.nil?
  }
end

- (Object) create_limitation_text



15
16
17
# File 'src/model/slentry.rb', line 15

def create_limitation_text
  @limitation_text = LimitationText.new
end

- (Object) delete_limitation_text



18
19
20
21
22
# File 'src/model/slentry.rb', line 18

def delete_limitation_text
  @limitation_text = nil
  self.odba_isolated_store
  nil
end

- (Object) pointer_descr



23
24
25
# File 'src/model/slentry.rb', line 23

def pointer_descr
  :sl_entry
end