Class: Nusii::LineItem

Inherits:
Resource show all
Extended by:
Crud::Destroy, Crud::List
Includes:
Crud::DestroySelf
Defined in:
lib/nusii/line_item.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Crud::List

list

Methods included from Crud::Destroy

destroy

Methods included from Crud::DestroySelf

#destroy

Methods inherited from Resource

class_name, #editable_params, #initialize, #save_params

Constructor Details

This class inherits a constructor from Nusii::Resource

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def amount
  @amount
end

#amount_formattedObject

Returns the value of attribute amount_formatted.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def amount_formatted
  @amount_formatted
end

#amount_in_centsObject

Returns the value of attribute amount_in_cents.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def amount_in_cents
  @amount_in_cents
end

#cost_typeObject

Returns the value of attribute cost_type.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def cost_type
  @cost_type
end

#created_atObject

Returns the value of attribute created_at.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def created_at
  @created_at
end

#currencyObject

Returns the value of attribute currency.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def currency
  @currency
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def id
  @id
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def name
  @name
end

#per_typeObject

Returns the value of attribute per_type.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def per_type
  @per_type
end

#positionObject

Returns the value of attribute position.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def position
  @position
end

#quantityObject

Returns the value of attribute quantity.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def quantity
  @quantity
end

#recurring_typeObject

Returns the value of attribute recurring_type.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def recurring_type
  @recurring_type
end

#section_idObject

Returns the value of attribute section_id.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def section_id
  @section_id
end

#total_formattedObject

Returns the value of attribute total_formatted.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def total_formatted
  @total_formatted
end

#total_in_centsObject

Returns the value of attribute total_in_cents.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def total_in_cents
  @total_in_cents
end

#updated_atObject

Returns the value of attribute updated_at.



7
8
9
# File 'lib/nusii/line_item.rb', line 7

def updated_at
  @updated_at
end

Class Method Details

.create_with_section(section_id, params) ⇒ Object



17
18
19
20
# File 'lib/nusii/line_item.rb', line 17

def self.create_with_section section_id, params
  requester = Nusii::Request.new
  requester.nested_create_call self, section_id, Nusii::Section, params
end

.list_by_section(section_id, options = {}) ⇒ Object



12
13
14
15
# File 'lib/nusii/line_item.rb', line 12

def self.list_by_section section_id, options={}
  requester = Nusii::Request.new
  requester.nested_index_call self, section_id, Nusii::Section, options
end

Instance Method Details

#saveObject

Raises:

  • (ArgumentError)


22
23
24
25
26
27
# File 'lib/nusii/line_item.rb', line 22

def save
  raise(ArgumentError, 'You can\'t update a line item without id') if self.id.blank?

  requester = Nusii::Request.new
  requester.update_call self.class, self
end