class Maestrano::OpenStruct

Extend OpenStruct to include a 'attributes' method

Public Instance Methods

attributes() click to toggle source

Return all object defined attributes

# File lib/maestrano/open_struct.rb, line 5
def attributes
  if self.respond_to?(:to_h)
    self.to_h.keys
  else
    (self.methods - self.class.new.methods).reject {|method| method =~ /=$/ }
  end
end