Class: Superset::Security::Role::Create

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/security/role/create.rb

Constant Summary

Constants inherited from Request

Request::PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Request

#page_num

Instance Method Summary collapse

Methods inherited from Request

call, #query_params, #result, #superset_host

Methods included from Display

#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title

Constructor Details

#initialize(name: '') ⇒ Create

Returns a new instance of Create.



7
8
9
# File 'lib/superset/security/role/create.rb', line 7

def initialize(name: '')
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/superset/security/role/create.rb', line 5

def name
  @name
end

Instance Method Details

#responseObject



11
12
13
14
15
# File 'lib/superset/security/role/create.rb', line 11

def response
  raise InvalidParameterError unless name.present?

  @response ||= client.post(route, { 'name' => name } )
end