Class: Parse::Card

Inherits:
Object show all
Includes:
FromHash
Defined in:
lib/ascension/parse.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.input_field(*args) ⇒ Object



151
152
153
# File 'lib/ascension/parse.rb', line 151

def self.input_field(*args)
  attr_accessor *args
end

Instance Method Details

#mod_for_phrases(raw, cat, card) ⇒ Object



164
165
166
167
168
169
170
# File 'lib/ascension/parse.rb', line 164

def mod_for_phrases(raw, cat, card)
  return unless raw
  #puts [raw,cat,card_class,name].inspect
  raw.split(",").each do |r|
    phrase(r,cat).mod_card(card)
  end
end

#phrase(raw, cat) ⇒ Object



160
161
162
163
# File 'lib/ascension/parse.rb', line 160

def phrase(raw, cat)
  return nil unless raw
  Phrase.parsed(raw).tap { |x| x.category = cat }
end