Class: ConvenientService::Examples::Standard::Cowsay::Services::Print

Inherits:
Object
  • Object
show all
Includes:
Service::Configs::Standard
Defined in:
lib/convenient_service/examples/standard/cowsay/services/print.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text: "Hello World!", out: $stdout) ⇒ Print

Returns a new instance of Print.



17
18
19
20
# File 'lib/convenient_service/examples/standard/cowsay/services/print.rb', line 17

def initialize(text: "Hello World!", out: $stdout)
  @text = text
  @out = out
end

Instance Attribute Details

#outObject (readonly)

Returns the value of attribute out.



11
12
13
# File 'lib/convenient_service/examples/standard/cowsay/services/print.rb', line 11

def out
  @out
end

#textObject (readonly)

Returns the value of attribute text.



11
12
13
# File 'lib/convenient_service/examples/standard/cowsay/services/print.rb', line 11

def text
  @text
end

Instance Method Details

#resultObject



22
23
24
25
26
# File 'lib/convenient_service/examples/standard/cowsay/services/print.rb', line 22

def result
  out.puts cloud + cow

  success
end