Class: Helpers
- Inherits:
-
Object
- Object
- Helpers
- Defined in:
- lib/foxit/helpers.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#objects_to_hash(obj_array) ⇒ Object
8 9 10 11 12 |
# File 'lib/foxit/helpers.rb', line 8 def objects_to_hash obj_array docs = [] obj_array.map { |obj| docs << obj.to_hash } docs end |
#to_hash ⇒ Object
2 3 4 5 6 |
# File 'lib/foxit/helpers.rb', line 2 def to_hash hash = {} instance_variables.each {|x| hash[x.to_s.delete("@")] = instance_variable_get(x)} hash end |