Class: Spec::DSL::Description

Inherits:
Object
  • Object
show all
Extended by:
ClassMethods
Defined in:
lib/spec/dsl/description.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

generate_description

Constructor Details

#initialize(*args) ⇒ Description

Returns a new instance of Description.


19
20
21
22
23
24
25
# File 'lib/spec/dsl/description.rb', line 19

def initialize(*args)
  args, @options = args_and_options(*args)
  init_behaviour_type(@options)
  init_spec_path(@options)
  init_described_type(args)
  init_description(*args)
end

Instance Attribute Details

#described_typeObject (readonly)

Returns the value of attribute described_type.


17
18
19
# File 'lib/spec/dsl/description.rb', line 17

def described_type
  @described_type
end

#descriptionObject (readonly)

Returns the value of attribute description.


17
18
19
# File 'lib/spec/dsl/description.rb', line 17

def description
  @description
end

Instance Method Details

#==(value) ⇒ Object


37
38
39
40
41
42
43
44
# File 'lib/spec/dsl/description.rb', line 37

def ==(value)
  case value
  when Description
    @description == value.description
  else
    @description == value
  end
end

#[](key) ⇒ Object


27
28
29
# File 'lib/spec/dsl/description.rb', line 27

def [](key)
  @options[key]
end

#[]=(key, value) ⇒ Object


31
32
33
# File 'lib/spec/dsl/description.rb', line 31

def []=(key, value)
  @options[key] = value
end

#to_sObject


35
# File 'lib/spec/dsl/description.rb', line 35

def to_s; @description; end