Class: BeanSprout::Sprout
- Inherits:
-
Object
- Object
- BeanSprout::Sprout
- Includes:
- PackagePrivate::InternalClass
- Defined in:
- lib/bean_sprout/entry.rb
Overview
Entry is made up of the following fields:
-
The account owns the entry, the currency of which is defined as the local
currency;
-
The amount to be added to the account balance, in local currency;
-
Other arbitrary data.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#bean ⇒ Object
readonly
Returns the value of attribute bean.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes included from PackagePrivate::InternalClass
Instance Method Summary collapse
-
#initialize(id, bean, amount) ⇒ Sprout
constructor
A new instance of Sprout.
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
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
13 14 15 |
# File 'lib/bean_sprout/entry.rb', line 13 def amount @amount end |
#bean ⇒ Object (readonly)
Returns the value of attribute bean.
13 14 15 |
# File 'lib/bean_sprout/entry.rb', line 13 def bean @bean end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'lib/bean_sprout/entry.rb', line 13 def id @id end |