Sha256: abbb9573a057fe28098dd82c9399ffbc0e67388a6d5e15e7f71d324ef96c007d

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

# encoding: utf-8

module AfrLoad
  class TvProgram
    attr_accessor :on_air_date,
      :on_air_start, :on_air_end,
      :title_ja, :title,
      :released_year, :released_country,
      :movie_director,
      :leading_actor, :supporting_actor

    def initialize()
      yield(self) if block_given?
    end

    def show()
      puts values
    end

    def values
      vals = instance_variables.each.map do |var|
        k = var.to_s.tr("@","")
        v = instance_variable_get(var)
        "#{k}: #{v}"
      end
      vals.join(", ")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
afr_load-0.1.9 lib/afr_load/tv_program.rb