class Marvel101::Character

Constants

DETAIL_ORDER

Attributes

details[RW]
list[RW]
team[RW]

Public Instance Methods

display() click to toggle source
# File lib/marvel_101/character.rb, line 10
def display
  display_description
  display_details
  display_links
  display_empty_message if no_info?
end
display_details() click to toggle source
# File lib/marvel_101/character.rb, line 17
def display_details
  DETAIL_ORDER.each do |type|
    if details.include?(type)
      title = type.to_s.split("_").join(" ").upcase
      format_output("#{title}: #{details[type]}")
      puts "" if "#{title}: #{details[type]}".size > 60
    end
  end
end
display_empty_message() click to toggle source
# File lib/marvel_101/character.rb, line 27
def display_empty_message
  puts "Sorry, Marvel doesn't seem to care about #{name}"
  puts "Type 'source' to open source in browser, but don't get your hopes up"
end
no_info?() click to toggle source
# File lib/marvel_101/character.rb, line 32
def no_info?
  !description && details.empty? && urls.size <= 1
end
valid_input?(input) click to toggle source
# File lib/marvel_101/character.rb, line 36
def valid_input?(input)
  false
end