Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Autoload 'yaml' in the to_yaml methods
This should add some convenience to users as they don't need to
explicitly load the yaml library before using these methods.
  • Loading branch information
dicom committed Jan 20, 2014
1 parent 691a5e8 commit 3b8eea9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/dicom/element.rb
Expand Up @@ -187,6 +187,7 @@ def to_json
# @return [String] a string containing a key & value pair (e.g. "---\nModality: MR\n")
#
def to_yaml
require 'yaml'
to_hash.to_yaml
end

Expand Down
1 change: 1 addition & 0 deletions lib/dicom/parent.rb
Expand Up @@ -622,6 +622,7 @@ def to_json
# @return [String] a human-readable representation of this parent
#
def to_yaml
require 'yaml'
to_hash.to_yaml
end

Expand Down

0 comments on commit 3b8eea9

Please sign in to comment.