Class: NotionRb::Operations::Commands::Base
- Inherits:
-
Object
- Object
- NotionRb::Operations::Commands::Base
- Defined in:
- lib/notion_rb/operations/commands/base.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(id, opts = {}) ⇒ Base
constructor
A new instance of Base.
- #to_h ⇒ Object
Constructor Details
#initialize(id, opts = {}) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 17 |
# 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 |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
7 8 9 |
# File 'lib/notion_rb/operations/commands/base.rb', line 7 def args @args end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
7 8 9 |
# File 'lib/notion_rb/operations/commands/base.rb', line 7 def command @command end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/notion_rb/operations/commands/base.rb', line 7 def id @id end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/notion_rb/operations/commands/base.rb', line 7 def path @path end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
7 8 9 |
# File 'lib/notion_rb/operations/commands/base.rb', line 7 def table @table end |
Instance Method Details
#to_h ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/notion_rb/operations/commands/base.rb', line 19 def to_h { id: id, table: table, path: path, command: command, args: args } end |