Class: Qualityforward::Project

Inherits:
Hash
  • Object
show all
Includes:
Qualityforward
Defined in:
lib/qualityforward/project.rb

Constant Summary

Constants included from Qualityforward

VERSION

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Qualityforward

#method_missing

Constructor Details

#initialize(body = {}) ⇒ Project

Returns a new instance of Project.



5
6
7
8
# File 'lib/qualityforward/project.rb', line 5

def initialize(body = {})
  @client = Qualityforward::Client.new
  self.sets body
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Qualityforward

Class Method Details

.getObject



20
21
22
23
24
# File 'lib/qualityforward/project.rb', line 20

def self.get
  client = Qualityforward::Client.new(@@api_key)
  json = client.get '/api/v2/current_project.json'
  Qualityforward::Project.new(json)
end

Instance Method Details

#set(key, value) ⇒ Object



16
17
18
# File 'lib/qualityforward/project.rb', line 16

def set key, value
  self[key] = value
end

#sets(body) ⇒ Object



10
11
12
13
14
# File 'lib/qualityforward/project.rb', line 10

def sets body
  body.each do |key, value|
    self.set(key, value)
  end
end