Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:25:54+00:00 2026-05-30T05:25:54+00:00

So, I know there is a simple error, but I just can’t seem to

  • 0

So, I know there is a simple error, but I just can’t seem to spot it. I’m using Modules/Mixins for the first time and any help would be much appreciated. I keep getting this error:

undefined method `this_is' for Value:Module (NoMethodError)

But it looks like the method is there…Here are is my module and classes…

module Value
  def this_is
    puts "#{self.players_hand} is the players hand"
  end
end

require './value.rb'

class Player
  include Value
  attr_accessor :players_hand

  def initialize
    @players_hand = 0
  end

  def value_is
    Value.this_is
  end
end

require './player.rb'

class Game

  def initialize
    @player = Player.new
  end

  def start
    puts @player.players_hand
    puts @player.value_is
  end
end

game = Game.new
game.start
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:25:56+00:00Added an answer on May 30, 2026 at 5:25 am

    When you include Value inside of the Player class, you are making the Value module’s methods a part of the Player class, so the this_is method is not namespaced. Knowing that, we need to change this method:

    def value_is
      Value.this_is
    end
    

    To:

    def value_is
      this_is
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there is no simple answer to my question but I would appreciate
Simple query, possibly impossible but I know there are some clever people out there
I know this is a simple question for someone out there, but I have
This is something really simple, but I can't seem to find the answer anywhere,
I know there are a lot of these topics around but none seem to
does anyone know if there is a simple way to bind a textblock to
I would like to know if there is a simple way to parse HTML
I'm trying to write a simple game/utility to calculate poker odds. I know there's
Is there a simple way of rendering to a BufferedImage in Java3D? I know
I know there is a registry key indicating the install directory, but I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.