Skip to content

Instantly share code, notes, and snippets.

@inem
Created August 21, 2009 06:52
Show Gist options
  • Select an option

  • Save inem/171700 to your computer and use it in GitHub Desktop.

Select an option

Save inem/171700 to your computer and use it in GitHub Desktop.
protein_hits.to_json(:methods =>
[:mascot_identified_hit, :label, :confirmed?, :spot, :descrption, :comment_text,
:mascot_filename, :mascot_db_result_link, :order_name,
:isoelectric_point, :rms_error, :mascot_dat_file_id,
:peptides_above_identity_threshold, :peptides_above_homology_threshold, :sequence_coverage_percent, :sequence_coverage_percent_ms_ms, {:sequence_method_wrapper => 70}, :tag_list,
:peptides_with_ions_score, :score, :ms_score, :info_dump], :include => {:comments => {:only => [:comment, :id, :commenter_id], :methods => [:commenter_name, :date]}, :taggings => {:methods => [{:created_at => {:to_s => :short}}], :only => [], :include => {:tag => {:only => [:name, :background, :foreground]}, :tagger => {:only => :login}}}} )
// по дефолту protein_hits (1)
// "=>" ренэймим в proteins (2)
=@protein_hits => :proteins
// methods, only, except, include - с минусом (1)
// вместо include - "+name_of_association" (2)
-methods
:mascot_identified_hit
:label
:confirmed? => confirmed
:spot
:descrption
:comment_text
+comments
-only
:name
:background
:foreground
-methods
:commenter_name
:date
+taggings
-methods
// передача параметров в метод (3)
:created_at
.to_s(:short)
+tag
-only
:name
:background
:foreground
+tagger
-only
:login
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment