Module: Wukong::HashlikeClass::ClassMethods

Defined in:
lib/wukong/extensions/hashlike_class.rb

Instance Method Summary collapse

Instance Method Details

#has_members(*members) ⇒ Object Also known as: has_member



6
7
8
9
10
11
12
# File 'lib/wukong/extensions/hashlike_class.rb', line 6

def has_members *members
  self.members ||= []
  self.members = members.map(&:to_s) + self.members
  self.members.each do |member|
    attr_accessor member.to_sym
  end
end

#keysObject



14
15
16
# File 'lib/wukong/extensions/hashlike_class.rb', line 14

def keys
  members
end