Class: ODDB::AtcFacade

Inherits:
Object show all
Includes:
ResultSort
Defined in:
src/model/search_result.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from ResultSort

#dose_value, #galform_str, #generic_type_weight, #sort_result

Constructor Details

- (AtcFacade) initialize(atc, session, result)

A new instance of AtcFacade



12
13
14
15
16
17
18
# File 'src/model/search_result.rb', line 12

def initialize(atc, session, result)
  @atc = atc
  @session = session
  #@package_count = @packages.size
  @packages_sorted = false
  @result = result
end

Instance Attribute Details

- (Object) atc (readonly)

Returns the value of attribute atc



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

def atc
  @atc
end

Instance Method Details

- (Object) active_packages



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

def active_packages
  @packages ||= @atc.active_packages
end

- (Object) code



22
23
24
# File 'src/model/search_result.rb', line 22

def code
  @atc.code
end

- (Object) description(*args)



25
26
27
# File 'src/model/search_result.rb', line 25

def description(*args)
  @atc.description(*args)
end

- (Boolean) empty?

Returns:

  • (Boolean)


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

def empty?
  self.packages.empty?
end

- (Boolean) has_ddd?

Returns:

  • (Boolean)


34
35
36
# File 'src/model/search_result.rb', line 34

def has_ddd?
  @atc.has_ddd?
end

- (Object) odba_id



28
29
30
# File 'src/model/search_result.rb', line 28

def odba_id
  @atc.odba_id
end

- (Boolean) overflow?

Returns:

  • (Boolean)


37
38
39
# File 'src/model/search_result.rb', line 37

def overflow?
  @result.overflow?
end

- (Object) package_count(generic_type = nil)



51
52
53
# File 'src/model/search_result.rb', line 51

def package_count(generic_type=nil)
  @atc.package_count(generic_type)
end

- (Object) packages



43
44
45
46
47
48
49
50
# File 'src/model/search_result.rb', line 43

def packages
  @packages ||= @atc.active_packages
  unless(@packages_sorted)
    @packages = sort_result(@packages, @session)
    @packages_sorted = true
  end
  @packages
end

- (Object) parent_code



54
55
56
# File 'src/model/search_result.rb', line 54

def parent_code
  @atc.parent_code
end

- (Object) pointer



40
41
42
# File 'src/model/search_result.rb', line 40

def pointer
  @atc.pointer
end

- (Object) sequences



57
58
59
# File 'src/model/search_result.rb', line 57

def sequences
  @atc.sequences
end