Method naming and violating single responsibility I need your opinion. Which way do you think is right?

The definition of message in this code bothers me because it is a single method that has two separate behaviors.  Depending on how many arguments are passed the method will do different things--that stinks. 

On the other hand, calling message in the block just feels right. It is subtle. But the difference of assigning the message with or without the = seems more significant than it should.  I feel guilty for really wanting to code this way.

Here's a code example:

class Queue
    attr_accessor :id

    def initialize(id, &amp;block)
      if block_given?
        instance_eval(&amp;block)
      end
    end

    def message=(value)
        @message = value
    end

    # if no value is given then it reports the value
    def message(value=nil)
        value.nil? ? @message : @message = value
    end
end

Queue.new :test_queue do
    message "This is a test"
end


Alternatively, I could use another method for it.

set_message "This is a test"


This also doesn't have the same effect.

Opinions? Other options?
It looks like you're building a small DSL, in which event message "Hello" is analogous to, say, Rails' belongs_to :user. The difference is that while belongs_to is only, in a sense, a setter (it can't be called without an argument, and doesn't return any useful value), you've built message as a getter and a setter.

I think this is about context. In your example:

Queue.new :test_queue do
  message "This is a test"
end


..the use of message feels "right." But in this example, it doesn't:

q = Queue.new :test_queue

q.message "This is a test"


..at least not as much. q.message = "..." makes more sense here.

You could just leave it as-is, i.e. allow assignment both ways, using whichever you prefer and letting others use whichever they prefer. The other option would be to make it work one way inside the constructor block and another way on an instance object. Here's an article that's relevant to this approach, with an apropos shout-out to Factory Girl, which itself contains a great DSL.

Hope that helps!