diff options
author | icebaker <icebaker@proton.me> | 2023-05-13 12:47:32 -0300 |
---|---|---|
committer | icebaker <icebaker@proton.me> | 2023-05-13 12:47:32 -0300 |
commit | 0410850a980424f3585f2c438c93a402851ee27a (patch) | |
tree | 1debcbe558981edf4470fbc8fad9c27b58ecb9b4 | |
parent | 38df98d7b3250230376c4141e0e784d1e69ad481 (diff) |
improving state api
-rw-r--r-- | controllers/instance.rb | 2 | ||||
-rw-r--r-- | controllers/interfaces/cli.rb | 4 | ||||
-rw-r--r-- | controllers/session.rb | 7 |
3 files changed, 4 insertions, 9 deletions
diff --git a/controllers/instance.rb b/controllers/instance.rb index b22a785..503b388 100644 --- a/controllers/instance.rb +++ b/controllers/instance.rb @@ -23,7 +23,7 @@ module NanoBot end def cartridge - puts YAML.dump(@safe_cartridge) + @safe_cartridge end def state diff --git a/controllers/interfaces/cli.rb b/controllers/interfaces/cli.rb index 2a93044..da027f7 100644 --- a/controllers/interfaces/cli.rb +++ b/controllers/interfaces/cli.rb @@ -54,9 +54,9 @@ module NanoBot when 'repl' bot.repl when 'state' - bot.state + pp bot.state when 'cartridge' - bot.cartridge + puts YAML.dump(bot.cartridge) else raise "TODO: [#{params[:command]}]" end diff --git a/controllers/session.rb b/controllers/session.rb index afaca18..1eb600d 100644 --- a/controllers/session.rb +++ b/controllers/session.rb @@ -32,12 +32,7 @@ module NanoBot end def state - pp({ - state: { - path: @state_path, - content: @state - } - }) + { state: { path: @state_path, content: @state } } end def load_state |