Class: Mutation::Collection
Class Attribute Summary collapse
Instance Attribute Summary collapse
Attributes inherited from HashTable
#header, #types
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from HashTable
#<<, #[], #concat, #each, #formatted_header, header_off, header_on, #idx, #idx_keys, #inspect, line_class, line_type, #output, #preamble, #sample, #select!, #sort_by!, #sum, #update_index, #use_header?, use_header?, #wrap
#load_file
Methods included from Printer
#print, #write
Constructor Details
#initialize(obj = nil, opts = {}) ⇒ Collection
Returns a new instance of Collection.
131
132
133
134
135
136
137
|
# File 'lib/mutation_set.rb', line 131
def initialize(obj=nil,opts={})
opts[:types] = types_from_required opts
super obj, opts
unless @header
@mutation_config = YAML.load_file(opts[:mutation_config]) if opts[:mutation_config]
end
|
Class Attribute Details
.optional ⇒ Object
Returns the value of attribute optional.
101
102
103
|
# File 'lib/mutation_set.rb', line 101
def optional
@optional
end
|
.required ⇒ Object
Returns the value of attribute required.
101
102
103
|
# File 'lib/mutation_set.rb', line 101
def required
@required
end
|
Instance Attribute Details
#mutation_config ⇒ Object
Returns the value of attribute mutation_config.
99
100
101
|
# File 'lib/mutation_set.rb', line 99
def mutation_config
@mutation_config
end
|
Class Method Details
114
115
116
|
# File 'lib/mutation_set.rb', line 114
def c
@comment = c
end
|
.default_sleeve(sleeve = nil) ⇒ Object
110
111
112
|
# File 'lib/mutation_set.rb', line 110
def default_sleeve sleeve=nil
@default_sleeve ||= sleeve
end
|
.might_have(terms) ⇒ Object
106
107
108
|
# File 'lib/mutation_set.rb', line 106
def might_have terms
@optional = terms
end
|
.requires(terms) ⇒ Object
102
103
104
|
# File 'lib/mutation_set.rb', line 102
def requires terms
@required = terms
end
|
Instance Method Details
119
120
121
|
# File 'lib/mutation_set.rb', line 119
def s
s.to_s.gsub(/\s+/,"_").gsub(/[^\w]+/,"").downcase.to_sym
end
|
123
124
125
|
# File 'lib/mutation_set.rb', line 123
def
@headers.map {|h| h}
end
|
#required ⇒ Object
127
128
129
|
# File 'lib/mutation_set.rb', line 127
def required
self.class.required.keys
end
|