Class: Micronaut::Example

Inherits:
Object show all
Defined in:
lib/micronaut/example.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(behaviour, desc, options, example_block = nil) ⇒ Example

Returns a new instance of Example.



7
8
9
10
11
12
# File 'lib/micronaut/example.rb', line 7

def initialize(behaviour, desc, options, example_block=nil)
  @behaviour, @description, @options, @example_block = behaviour, desc, options, example_block
   = @behaviour..dup
  [:description] = description
  .update(options)
end

Instance Attribute Details

#behaviourObject (readonly)

Returns the value of attribute behaviour.



5
6
7
# File 'lib/micronaut/example.rb', line 5

def behaviour
  @behaviour
end

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/micronaut/example.rb', line 5

def description
  @description
end

#example_blockObject (readonly)

Returns the value of attribute example_block.



5
6
7
# File 'lib/micronaut/example.rb', line 5

def example_block
  @example_block
end

#metadataObject (readonly)

Returns the value of attribute metadata.



5
6
7
# File 'lib/micronaut/example.rb', line 5

def 
  
end

Instance Method Details

#inspectObject



14
15
16
# File 'lib/micronaut/example.rb', line 14

def inspect
  "#{@metadata[:behaviour][:name]} - #{@metadata[:description]}"
end

#to_sObject



18
19
20
# File 'lib/micronaut/example.rb', line 18

def to_s
  inspect
end