Class: PgEventstore::Extensions::OptionsExtension::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_eventstore/extensions/options_extension.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, metadata: nil) ⇒ Option

Returns a new instance of Option.

Parameters:

  • name (Symbol)
  • metadata (Object, nil) (defaults to: nil)


48
49
50
51
# File 'lib/pg_eventstore/extensions/options_extension.rb', line 48

def initialize(name, metadata: nil)
  @name = name
  @metadata = 
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



44
45
46
# File 'lib/pg_eventstore/extensions/options_extension.rb', line 44

def 
  @metadata
end

#nameObject (readonly)

Returns the value of attribute name.



44
45
46
# File 'lib/pg_eventstore/extensions/options_extension.rb', line 44

def name
  @name
end

Instance Method Details

#==(other_option) ⇒ Boolean

Parameters:

  • other_option (Object)

Returns:

  • (Boolean)


55
56
57
58
59
# File 'lib/pg_eventstore/extensions/options_extension.rb', line 55

def ==(other_option)
  return false unless other_option.is_a?(Option)

  name == other_option.name
end

#eql?(other_option) ⇒ Boolean

Parameters:

  • other_option (Object)

Returns:

  • (Boolean)


63
64
65
66
67
# File 'lib/pg_eventstore/extensions/options_extension.rb', line 63

def eql?(other_option)
  return false unless other_option.is_a?(Option)

  name.eql?(other_option.name)
end

#hashInteger

Returns:

  • (Integer)


70
71
72
# File 'lib/pg_eventstore/extensions/options_extension.rb', line 70

def hash
  name.hash
end