Class: Megam::KoniPai

Inherits:
Object
  • Object
show all
Defined in:
lib/megam/core/konipai.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeKoniPai

Returns a new instance of KoniPai.



4
5
6
# File 'lib/megam/core/konipai.rb', line 4

def initialize()
  @koni = nil
end

Class Method Details

.json_create(o) ⇒ Object



30
31
32
33
34
# File 'lib/megam/core/konipai.rb', line 30

def self.json_create(o)
  kp  = new
  kp.koni(o) if o != null
  kp
end

Instance Method Details

#koni(arg = nil) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/megam/core/konipai.rb', line 12

def koni(arg=nil)
  if arg != nil
    @koni = arg
  else
  @koni
  end
end

#konipaiObject



8
9
10
# File 'lib/megam/core/konipai.rb', line 8

def konipai
  self
end

#to_hashObject

Transform the ruby obj -> to a Hash



22
23
24
25
26
27
# File 'lib/megam/core/konipai.rb', line 22

def to_hash
  index_hash = Hash.new
  index_hash["json_claz"] = self.class.name
  index_hash["koni"] = koni
  index_hash
end

#to_sObject



37
38
39
# File 'lib/megam/core/konipai.rb', line 37

def to_s
  Megam::Stuff.styled_hash(to_hash)
end