Class: ODDB::Remote::Sequence

Inherits:
Object show all
Defined in:
src/remote/sequence.rb

Instance Method Summary (collapse)

Methods inherited from Object

#initialize

Constructor Details

This class inherits a constructor from ODDB::Remote::Object

Instance Method Details

- (Object) atc_code



11
12
13
# File 'src/remote/sequence.rb', line 11

def atc_code
  @atc_code ||= (atc = @remote.atc) && atc.code
end

- (Boolean) comparable?(other)

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
22
# File 'src/remote/sequence.rb', line 14

def comparable?(other)
  galenic_forms.size == other.galenic_forms.size \
    && doses == other.doses \
    && galenic_forms.each_with_index { |form, idx| 
      if !form.equivalent_to?(other.galenic_forms[idx])
        return false
      end
  }
end

- (Object) doses



23
24
25
# File 'src/remote/sequence.rb', line 23

def doses
  @doses ||= @remote.doses
end

- (Object) galenic_forms



26
27
28
29
30
# File 'src/remote/sequence.rb', line 26

def galenic_forms
  @galenic_forms ||= @remote.galenic_forms.collect { |form|
    Remote::GalenicForm.new(form)
  }
end