class NotionRb::Operations::Commands::Base

Attributes

args[R]
command[R]
id[R]
path[R]
table[R]

Public Class Methods

new(id, opts = {}) click to toggle source
# File lib/notion_rb/operations/commands/base.rb, line 9
def initialize(id, opts = {})
  @id = id
  @command = opts.fetch(:command) do
    raise ArgumentError, 'Commands must specify command action key'
  end
  @table = opts[:table]
  @args = opts[:args]
  @path = opts.fetch(:path, [])
end

Public Instance Methods

to_h() click to toggle source
# File lib/notion_rb/operations/commands/base.rb, line 19
def to_h
  {
    id: id,
    table: table,
    path: path,
    command: command,
    args: args
  }
end