Class: Cardio::Mod::Poop
- Inherits:
-
Object
- Object
- Cardio::Mod::Poop
- Defined in:
- lib/cardio/mod/poop.rb
Overview
POOP (or Plain Old OutPut) is our nickname for our standard card YAML, used to define cards associated with mods.
Monkeys throw it around, and Sharks can eat it (if you believe this guy: www.youtube.com/watch?v=VvEa4NSqw7I).
docs.google.com/document/d/13K_ynFwfpHwc3t5gnLeAkZJZHco1wK063nJNYwU8qfc/edit#
Instance Method Summary collapse
-
#dump ⇒ Object
write yaml to file.
- #field_tag_marks ⇒ Object
-
#filename ⇒ String
– MOD_DIR/data/ENVIRONMENT.yml.
-
#initialize(**args) ⇒ Poop
constructor
A new instance of Poop.
- #new_data ⇒ Array <Hash>
-
#out ⇒ Object
if output mod given,.
Constructor Details
Instance Method Details
#dump ⇒ Object
write yaml to file
48 49 50 51 52 |
# File 'lib/cardio/mod/poop.rb', line 48 def dump hash = output_hash File.write filename, hash.to_yaml puts "#{filename} now contains #{hash.size} items".green end |
#field_tag_marks ⇒ Object
25 26 27 28 29 |
# File 'lib/cardio/mod/poop.rb', line 25 def field_tag_marks @field_tag_marks ||= @field_tags.to_s.split(",").map do |mark| mark.strip.cardname.codename_or_string end end |
#filename ⇒ String
Returns – MOD_DIR/data/ENVIRONMENT.yml.
32 33 34 |
# File 'lib/cardio/mod/poop.rb', line 32 def filename @filename ||= File.join mod_path, "#{@env}.yml" end |
#new_data ⇒ Array <Hash>
21 22 23 |
# File 'lib/cardio/mod/poop.rb', line 21 def new_data @new_data ||= cards.map { |c| c.export_hash field_tags: field_tag_marks } end |