Class: Bio::RestrictionEnzyme::Range::SequenceRange::Fragments

Inherits:
Array
  • Object
show all
Defined in:
lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb

Defined Under Namespace

Classes: DisplayFragment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(primary, complement) ⇒ Fragments


22
23
24
25
# File 'lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb', line 22

def initialize(primary, complement)
  @primary = primary
  @complement = complement
end

Instance Attribute Details

#complementObject

Returns the value of attribute complement


20
21
22
# File 'lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb', line 20

def complement
  @complement
end

#primaryObject

Returns the value of attribute primary


19
20
21
# File 'lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb', line 19

def primary
  @primary
end

Instance Method Details

#for_display(p_str = nil, c_str = nil) ⇒ Object


29
30
31
32
33
34
35
# File 'lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb', line 29

def for_display(p_str=nil, c_str=nil)
  p_str ||= @primary
  c_str ||= @complement
  pretty_fragments = []
  self.each { |fragment| pretty_fragments << fragment.for_display(p_str, c_str) }
  pretty_fragments
end