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.



19
20
21
# File 'lib/megam/core/konipai.rb', line 19

def initialize()
  @koni = nil
end

Class Method Details

.json_create(o) ⇒ Object



45
46
47
48
49
# File 'lib/megam/core/konipai.rb', line 45

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

Instance Method Details

#koni(arg = nil) ⇒ Object



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

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

#konipaiObject



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

def konipai
  self
end

#to_hashObject

Transform the ruby obj -> to a Hash



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

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

#to_sObject



52
53
54
# File 'lib/megam/core/konipai.rb', line 52

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