Class: ODDB::Analysis::Position

Inherits:
Object
  • Object
show all
Includes:
FeedbackObserver, Persistence, SimpleLanguage
Defined in:
src/model/analysis/position.rb

Constant Summary

ODBA_SERIALIZABLE =
['@descriptions', '@lab_areas']

Constants included from Persistence

ODBA_PREDEFINE_SERIALIZABLE

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from SimpleLanguage

#description, #descriptions, #has_description?, #match, #method_missing, #respond_to?, #to_s, #update_values

Methods included from PersistenceMethods

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

Methods included from FeedbackObserver

#add_feedback, #feedback, #remove_feedback

Constructor Details

- (Position) initialize(poscd)

A new instance of Position



26
27
28
29
30
# File 'src/model/analysis/position.rb', line 26

def initialize(poscd)
  @positions = {}
  @poscd = poscd
  @feedbacks = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ODDB::SimpleLanguage

Instance Attribute Details

- (Object) analysis_revision

Returns the value of attribute analysis_revision



19
20
21
# File 'src/model/analysis/position.rb', line 19

def analysis_revision
  @analysis_revision
end

- (Object) anonymous

Returns the value of attribute anonymous



19
20
21
# File 'src/model/analysis/position.rb', line 19

def anonymous
  @anonymous
end

- (Object) anonymousgroup

Returns the value of attribute anonymousgroup



19
20
21
# File 'src/model/analysis/position.rb', line 19

def anonymousgroup
  @anonymousgroup
end

- (Object) anonymouspos

Returns the value of attribute anonymouspos



19
20
21
# File 'src/model/analysis/position.rb', line 19

def anonymouspos
  @anonymouspos
end

- (Object) finding

Returns the value of attribute finding



19
20
21
# File 'src/model/analysis/position.rb', line 19

def finding
  @finding
end

- (Object) footnote (readonly)

Returns the value of attribute footnote



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

def footnote
  @footnote
end

- (Object) group

Returns the value of attribute group



19
20
21
# File 'src/model/analysis/position.rb', line 19

def group
  @group
end

- (Object) lab_areas

Returns the value of attribute lab_areas



19
20
21
# File 'src/model/analysis/position.rb', line 19

def lab_areas
  @lab_areas
end

- (Object) limitation_text (readonly)

Returns the value of attribute limitation_text



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

def limitation_text
  @limitation_text
end

- (Object) list_title (readonly)

Returns the value of attribute list_title



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

def list_title
  @list_title
end

- (Object) permissions (readonly)

Returns the value of attribute permissions



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

def permissions
  @permissions
end

- (Object) poscd Also known as: pointer_descr

Returns the value of attribute poscd



19
20
21
# File 'src/model/analysis/position.rb', line 19

def poscd
  @poscd
end

- (Object) taxnote (readonly)

Returns the value of attribute taxnote



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

def taxnote
  @taxnote
end

- (Object) taxnumber

Returns the value of attribute taxnumber



19
20
21
# File 'src/model/analysis/position.rb', line 19

def taxnumber
  @taxnumber
end

- (Object) taxpoint_type

Returns the value of attribute taxpoint_type



19
20
21
# File 'src/model/analysis/position.rb', line 19

def taxpoint_type
  @taxpoint_type
end

- (Object) taxpoints

Returns the value of attribute taxpoints



19
20
21
# File 'src/model/analysis/position.rb', line 19

def taxpoints
  @taxpoints
end

Instance Method Details

- (Object) code



31
32
33
# File 'src/model/analysis/position.rb', line 31

def code
  [groupcd, @poscd].join('.')
end

- (Object) create_detail_info(lab_key)



34
35
36
37
# File 'src/model/analysis/position.rb', line 34

def create_detail_info(lab_key)
  detail_info = DetailInfo.new(lab_key)
  detail_infos.store(lab_key, detail_info)
end

- (Object) create_footnote



38
39
40
# File 'src/model/analysis/position.rb', line 38

def create_footnote
  @footnote = Text::Document.new
end

- (Object) create_limitation_text



41
42
43
# File 'src/model/analysis/position.rb', line 41

def create_limitation_text
  @limitation_text = LimitationText.new
end

- (Object) create_list_title



44
45
46
# File 'src/model/analysis/position.rb', line 44

def create_list_title
  @list_title = Text::Document.new
end

- (Object) create_permissions



47
48
49
# File 'src/model/analysis/position.rb', line 47

def create_permissions
  @permissions = Text::Document.new
end

- (Object) create_taxnote



50
51
52
# File 'src/model/analysis/position.rb', line 50

def create_taxnote
  @taxnote = Text::Document.new
end

- (Object) delete_detail_info(lab_key)



53
54
55
56
57
58
# File 'src/model/analysis/position.rb', line 53

def delete_detail_info(lab_key)
  if(info = detail_infos.delete(lab_key))
    @detail_infos.odba_isolated_store
    info
  end
end

- (Object) delete_footnote



59
60
61
62
63
64
# File 'src/model/analysis/position.rb', line 59

def delete_footnote
  if(fn = @footnote)
    @footnote = nil
    fn
  end
end

- (Object) delete_limitation_text



65
66
67
68
69
70
# File 'src/model/analysis/position.rb', line 65

def delete_limitation_text
  if(lt = @limitation_text)
    @limitation_text = nil
    lt
  end
end

- (Object) delete_list_title



71
72
73
74
75
76
# File 'src/model/analysis/position.rb', line 71

def delete_list_title
  if(title = @list_title)
    @list_title = nil
    title
  end
end

- (Object) delete_permissions



77
78
79
80
81
82
# File 'src/model/analysis/position.rb', line 77

def delete_permissions
  if(perm = @permissions)
    @permissions = nil
    perm
  end
end

- (Object) delete_taxnote



83
84
85
86
87
88
# File 'src/model/analysis/position.rb', line 83

def delete_taxnote
  if(tn = @taxnote)
    @taxnote = nil
    tn
  end
end

- (Object) detail_info(lab_key)



89
90
91
# File 'src/model/analysis/position.rb', line 89

def detail_info(lab_key)
  detail_infos[lab_key]
end

- (Object) detail_infos



92
93
94
# File 'src/model/analysis/position.rb', line 92

def detail_infos
  @detail_infos ||= {}
end

- (Object) groupcd



95
96
97
# File 'src/model/analysis/position.rb', line 95

def groupcd
  @group.groupcd
end

- (Object) localized_name(language)



115
116
117
# File 'src/model/analysis/position.rb', line 115

def localized_name(language)
   self.send(language)
end

- (Object) search_text(language)



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'src/model/analysis/position.rb', line 98

def search_text(language)
  terms = [@list_title, @taxnote, @footnote,
    @limitation_text, self].compact.collect { |doc|
    doc.send(language).split(/\s+/u)
  }
  if(@permissions)
    @permissions.send(language).each { |perm|
      if(rest = perm.restriction)
        terms.concat(rest.split(' '))
      end
      terms.concat(perm.specialization.split(' '))
    }
  end
  terms.concat(detail_infos.values)
  terms.push(groupcd, code)
  ODDB.search_term(terms.join("\n"))
end