# Need help with calling and adding values to another file

**URL:** <https://www.ruby-forum.com/t/need-help-with-calling-and-adding-values-to-another-file/259923>\
**Category:** Uncategorized\
**Created:** [July 1, 2020, 2:39pm UTC](https://www.ruby-forum.com/t/need-help-with-calling-and-adding-values-to-another-file/259923 "2020-07-01T14:39:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KillerWalrus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@KillerWalrus](https://www.ruby-forum.com/u/KillerWalrus)\
**Post date:** [July 1, 2020, 2:39pm UTC](https://www.ruby-forum.com/t/need-help-with-calling-and-adding-values-to-another-file/259923/1 "2020-07-01T14:39:39Z")

</div>

relative\_relative ´gold\_object´

class Shop\_Object  
def initialize

gold = Gold.new()  
@gold = gold

end

def shop\_now

…  
@gold.gold\_amount -= 100  
…

#another file

gold\_object

def gold\_amount

gold = 200

end
