Class: BaseCRM::Deal

Inherits:
Model
  • Object
show all
Defined in:
lib/basecrm/models/deal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Deal

attr_accessor :contact_id attr_accessor :currency attr_accessor :custom_fields attr_accessor :customized_win_likelihood attr_accessor :estimated_close_date attr_accessor :hot attr_accessor :last_stage_change_at attr_accessor :loss_reason_id attr_accessor :name attr_accessor :owner_id attr_accessor :source_id attr_accessor :stage_id attr_accessor :tags attr_accessor :added_on attr_accessor :value



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

Instance Attribute Details

#added_onDateTime

Returns Date and time when the deal was added in UTC (ISO8601 format).

Returns:

  • (DateTime)

    Date and time when the deal was added in UTC (ISO8601 format).



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#contact_idInteger

Returns Unique identifier of a primary contact.

Returns:

  • (Integer)

    Unique identifier of a primary contact.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#created_atDateTime (readonly)

Returns Date and time that the deal was created in UTC (ISO8601 format).

Returns:

  • (DateTime)

    Date and time that the deal was created in UTC (ISO8601 format).



# File 'lib/basecrm/models/deal.rb', line 5

#creator_idInteger (readonly)

Returns Unique identifier of the user who created the deal.

Returns:

  • (Integer)

    Unique identifier of the user who created the deal.



# File 'lib/basecrm/models/deal.rb', line 5

#currencyString

Returns Currency of the deal, specified in 3-character currency code (ISO4217) format.

Returns:

  • (String)

    Currency of the deal, specified in 3-character currency code (ISO4217) format.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#custom_fieldsHash

Returns Custom fields are key-value data attached to a deal. See more at [Custom Fields](/docs/rest/articles/requests#custom_fields).

Returns:

  • (Hash)

    Custom fields are key-value data attached to a deal. See more at [Custom Fields](/docs/rest/articles/requests#custom_fields).



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#customized_win_likelihoodInteger

Returns User-provided win likelihood with value range 0-100.

Returns:

  • (Integer)

    User-provided win likelihood with value range 0-100.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#dropbox_emailString (readonly)

Returns Dropbox email connected with the deal.

Returns:

  • (String)

    Dropbox email connected with the deal.



# File 'lib/basecrm/models/deal.rb', line 5

#estimated_close_dateString

Returns Estimated close date of the deal.

Returns:

  • (String)

    Estimated close date of the deal



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#hotBoolean

Returns Indicator of whether or not the deal is hot.

Returns:

  • (Boolean)

    Indicator of whether or not the deal is hot.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#idInteger (readonly)

Returns Unique identifier of the deal.

Returns:

  • (Integer)

    Unique identifier of the deal.



# File 'lib/basecrm/models/deal.rb', line 5

#last_stage_change_atDateTime

Returns Date and time when the deal was moved into the current stage in UTC (ISO8601 format).

Returns:

  • (DateTime)

    Date and time when the deal was moved into the current stage in UTC (ISO8601 format).



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#last_stage_change_by_idInteger (readonly)

Returns Unique identifier of the user who moved the deal into the current stage.

Returns:

  • (Integer)

    Unique identifier of the user who moved the deal into the current stage.



# File 'lib/basecrm/models/deal.rb', line 5

#loss_reason_idInteger

Returns Reason why the deal was lost.

Returns:

  • (Integer)

    Reason why the deal was lost.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#nameString

Returns Name of the deal.

Returns:

  • (String)

    Name of the deal.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#organization_idInteger (readonly)

Returns Unique identifier of an organization.

Returns:

  • (Integer)

    Unique identifier of an organization.



# File 'lib/basecrm/models/deal.rb', line 5

#owner_idInteger

Returns Unique identifier of the user that the deal is assigned to.

Returns:

  • (Integer)

    Unique identifier of the user that the deal is assigned to.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#source_idInteger

Returns Unique identifier of the Source.

Returns:

  • (Integer)

    Unique identifier of the Source.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#stage_idInteger

Returns Unique identifier of the deal’s current stage in the pipeline.

Returns:

  • (Integer)

    Unique identifier of the deal’s current stage in the pipeline.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#tagsArray<String>

Returns An array of tags for a deal. See more at [Tags](/docs/rest/articles/requests#tags).

Returns:

  • (Array<String>)

    An array of tags for a deal. See more at [Tags](/docs/rest/articles/requests#tags).



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end

#updated_atDateTime (readonly)

Returns Date and time of the last update on the deal in UTC (ISO8601 format).

Returns:

  • (DateTime)

    Date and time of the last update on the deal in UTC (ISO8601 format).



# File 'lib/basecrm/models/deal.rb', line 5

#valueBigDecimal

Returns Value of the deal in a currency specified in the ‘currency` field.

Returns:

  • (BigDecimal)

    Value of the deal in a currency specified in the ‘currency` field.



73
74
75
76
# File 'lib/basecrm/models/deal.rb', line 73

def initialize(*args)
  super
  @table[:value] = BaseCRM::Coercion.to_decimal_value(@table[:value] || 0)
end