Class: GMoney::Transaction

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

Defined Under Namespace

Classes: TransactionRequestError

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#commissionObject

Returns the value of attribute commission.



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

def commission
  @commission
end

#dateObject

Returns the value of attribute date.



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

def date
  @date
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#notesObject

Returns the value of attribute notes.



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

def notes
  @notes
end

#priceObject

Returns the value of attribute price.



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

def price
  @price
end

#sharesObject

Returns the value of attribute shares.



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

def shares
  @shares
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#updatedObject (readonly)

Returns the value of attribute updated.



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

def updated
  @updated
end

Class Method Details

.find_by_url(url) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gmoney/transaction.rb', line 9

def self.find_by_url(url)
  transactions = []
  
  response = GFService.send_request(GFRequest.new(url, :headers => {"Authorization" => "GoogleLogin auth=#{GFSession.auth_token}"}))
  
  if response.status_code == HTTPOK
    TransactionFeedParser.parse_transaction_feed(response.body)
  else
    raise TransactionRequestError
  end
end