Class: RdInsightly::Lead

Inherits:
Object
  • Object
show all
Defined in:
lib/rd_insightly/lead.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Lead

Returns a new instance of Lead.



5
6
7
# File 'lib/rd_insightly/lead.rb', line 5

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/rd_insightly/lead.rb', line 3

def name
  @name
end

Class Method Details

.allObject



15
16
17
18
# File 'lib/rd_insightly/lead.rb', line 15

def self.all
  fail ApiTokenException unless RdInsightly.authorized?
  ApiInsightly.leads
end

.create(name = nil) ⇒ Object



9
10
11
12
13
# File 'lib/rd_insightly/lead.rb', line 9

def self.create(name = nil)
  fail LeadException if name.nil?
  fail ApiTokenException unless RdInsightly.authorized?
  Lead.new name
end