module SetBuilder

Constants

VERSION

Attributes

traits[R]

Public Class Methods

extended(base) click to toggle source
# File lib/set_builder.rb, line 13
def self.extended(base)
  base.instance_variable_set("@traits", SetBuilder::Traits.new)
  base.send(:include, SetBuilder::Modifiers)
end

Public Instance Methods

modifiers() click to toggle source
# File lib/set_builder.rb, line 22
def modifiers
  traits.modifiers
end
that_belong_to(set) click to toggle source
# File lib/set_builder.rb, line 27
def that_belong_to(set)
  SetBuilder::Set.new(self, set)
end

Protected Instance Methods

get_part_of_speech(arg) click to toggle source
# File lib/set_builder.rb, line 43
def get_part_of_speech(arg)
  case arg
  when :is, :are, :reflexive
    :reflexive
  when nil, :active
    :active
  when :was, :were, :passive
    :passive
  when :has, :have, :perfect
    :perfect
  when :whose, :noun
    :noun
  end
end
trait(*args, &block) click to toggle source
# File lib/set_builder.rb, line 36
def trait(*args, &block)
  part_of_speech = get_part_of_speech(args.shift)
  name = args.shift
  traits << Trait.new(name, part_of_speech, *args, &block)
end