Created
December 20, 2014 16:46
-
-
Save rcdexta/2125e2e3d2748c048a6a to your computer and use it in GitHub Desktop.
Illustrating Hash19 features
This file contains hidden or 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 MovieOMeter | |
include Hash19 | |
contains :movies | |
inject at: '$.movies', using: :movie_name, reference: :name, | |
trigger: lambda { |names| IMDB.find_all_movie_ratings names }, as: 'ratings' | |
inject at: '$.movies', using: :movie_name, reference: :name, | |
trigger: lambda { |names| Twitter.search_by_terms names }, as: 'twitter_sentiments' | |
end | |
class Movie | |
include Hash19 | |
attributes :name, :year, :genre, :language, :photo_url | |
attribute :story_line, key: :plot | |
has_many :actors | |
has_many :shows, using: :name, trigger: ->(name) { MovieTimings.get name } | |
end | |
class Actor | |
include Hash19 | |
attributes :name, :age, :character_name | |
has_one :photo | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment