Class: BeanSprout::Sprout

Inherits:
Object
  • Object
show all
Includes:
PackagePrivate::InternalClass
Defined in:
lib/bean_sprout/entry.rb

Overview

Entry is made up of the following fields:

  1. The account owns the entry, the currency of which is defined as the local

currency;

  1. The amount to be added to the account balance, in local currency;

  2. Other arbitrary data.

Instance Attribute Summary collapse

Attributes included from PackagePrivate::InternalClass

#public_interface

Instance Method Summary collapse

Methods included from PackagePrivate::InternalClass

#bind_public_interface, included

Constructor Details

#initialize(id, bean, amount) ⇒ Sprout

Returns a new instance of Sprout.



17
18
19
20
21
# File 'lib/bean_sprout/entry.rb', line 17

def initialize id, bean, amount
  @id = id
  @bean = bean
  @amount = amount.to_d
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



13
14
15
# File 'lib/bean_sprout/entry.rb', line 13

def amount
  @amount
end

#beanObject (readonly)

Returns the value of attribute bean.



13
14
15
# File 'lib/bean_sprout/entry.rb', line 13

def bean
  @bean
end

#idObject (readonly)

Returns the value of attribute id.



13
14
15
# File 'lib/bean_sprout/entry.rb', line 13

def id
  @id
end