Class: ActionService::Struct

Inherits:
Object
  • Object
show all
Defined in:
lib/action_service/struct.rb

Class Method Summary collapse

Class Method Details

.member(name, type) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/action_service/struct.rb', line 3

def self.member(name, type)
  write_inheritable_hash("struct_members", name => type)
  class_eval <<-END
    def #{name}; @#{name}; end
    def #{name}=(value); @#{name} = value; end
  END
end

.membersObject



11
12
13
# File 'lib/action_service/struct.rb', line 11

def self.members
  read_inheritable_attribute("struct_members") || {}
end