Class: GMoney::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/gmoney/transaction.rb

Defined Under Namespace

Classes: TransactionDeleteError, TransactionRequestError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commissionObject

Returns the value of attribute commission.



8
9
10
# File 'lib/gmoney/transaction.rb', line 8

def commission
  @commission
end

#dateObject

Returns the value of attribute date.



8
9
10
# File 'lib/gmoney/transaction.rb', line 8

def date
  @date
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/gmoney/transaction.rb', line 6

def id
  @id
end

#notesObject

Returns the value of attribute notes.



8
9
10
# File 'lib/gmoney/transaction.rb', line 8

def notes
  @notes
end

#priceObject

Returns the value of attribute price.



8
9
10
# File 'lib/gmoney/transaction.rb', line 8

def price
  @price
end

#sharesObject

Returns the value of attribute shares.



8
9
10
# File 'lib/gmoney/transaction.rb', line 8

def shares
  @shares
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/gmoney/transaction.rb', line 6

def title
  @title
end

#typeObject

Returns the value of attribute type.



8
9
10
# File 'lib/gmoney/transaction.rb', line 8

def type
  @type
end

#updatedObject (readonly)

Returns the value of attribute updated.



6
7
8
# File 'lib/gmoney/transaction.rb', line 6

def updated
  @updated
end

Class Method Details

.delete(id) ⇒ Object



14
15
16
# File 'lib/gmoney/transaction.rb', line 14

def self.delete(id)
  delete_transaction(id)
end

.find(id, options = {}) ⇒ Object



10
11
12
# File 'lib/gmoney/transaction.rb', line 10

def self.find(id, options={})   
  find_by_url("#{GF_PORTFOLIO_FEED_URL}/#{id.portfolio_id}/positions/#{id.position_id}/transactions/#{id.transaction_id}", options)    
end

Instance Method Details

#deleteObject



18
19
20
21
# File 'lib/gmoney/transaction.rb', line 18

def delete
  Transaction.delete(@id.transaction_feed_id)
  freeze
end