Created
March 28, 2016 22:57
-
-
Save perezpaya/66baed041d990edd7520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Company < Model | |
attribute :stock_symbol, type: String | |
attribute :name, type: String | |
attribute :stock_price, type: Float | |
attribute :stock_volume, type: Integer | |
attribute :number_of_shares, type: Integer | |
has_one :ceo, class_name: 'Person' | |
def volume_price | |
stock_price * stock_volume | |
end | |
def valuation | |
stock_price * number_of_shares | |
end | |
end | |
class Person < Model | |
attribute :name, type: String | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment