Class: FentonShell::Organization

Inherits:
Object
  • Object
show all
Defined in:
lib/fenton_shell/organization.rb

Overview

Interfaces with the organization api on fenton server

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageString

Returns success or failure message and why.

Returns:

  • (String)

    success or failure message and why



6
7
8
# File 'lib/fenton_shell/organization.rb', line 6

def message
  @message
end

Instance Method Details

#create(global_options, options) ⇒ String

Creates a new organization on fenton server by sending a post request with json from the command line to create the organization

Parameters:

  • global_options (Hash)

    global command line options

  • options (Hash)

    json fields to send to fenton server

Returns:

  • (String)

    success or failure message



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fenton_shell/organization.rb', line 15

def create(global_options, options)
  status, body = organization_create(global_options, options)

  if status == 201
    save_message('Organization': ['created!'])
    true
  else
    save_message(body)
    false
  end
end