Class: Struct

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

Class Method Summary collapse

Class Method Details

.from_array(a) ⇒ Object



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

def self.from_array(a)
  a.collect do |b|
  end
end

.from_hash(h) ⇒ Object



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

def self.from_hash(h)
  o = new
  h.each do |m, v|
    o[m.to_sym] = v
  end
  o
end