Class: Zakuro::Result::Core
- Inherits:
-
Object
- Object
- Zakuro::Result::Core
- Defined in:
- lib/zakuro/result/core.rb
Overview
Core 共通処理
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(*_args) ⇒ Core
constructor
初期化.
-
#to_h ⇒ Hash<String, Object>
ハッシュ化する.
-
#to_json(*_args) ⇒ String
JSON化する.
-
#to_pretty_json ⇒ String
JSON(整形)化する.
Constructor Details
#initialize(*_args) ⇒ Core
初期化
20 |
# File 'lib/zakuro/result/core.rb', line 20 def initialize(*_args); end |
Instance Method Details
#to_h ⇒ Hash<String, Object>
ハッシュ化する
27 28 29 |
# File 'lib/zakuro/result/core.rb', line 27 def to_h Tool::Stringifier.to_h(obj: self, class_prefix: 'Zakuro::Result') end |
#to_json(*_args) ⇒ String
JSON化する
38 39 40 |
# File 'lib/zakuro/result/core.rb', line 38 def to_json(*_args) JSON.generate(to_h) end |
#to_pretty_json ⇒ String
JSON(整形)化する
47 48 49 |
# File 'lib/zakuro/result/core.rb', line 47 def to_pretty_json JSON.pretty_generate(to_h) end |