Class: FentonShell::Project

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

Overview

Interfaces with the project 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/project.rb', line 6

def message
  @message
end

Instance Method Details

#create(global_options, options) ⇒ String

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

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/project.rb', line 15

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

  if status == 201
    save_message(create_success_message(body))
    true
  else
    parse_message(body)
    false
  end
end