Class: Lazylead::Fake

Inherits:
Object
  • Object
show all
Defined in:
lib/lazylead/system/fake.rb,
lib/lazylead/system/jira.rb

Overview

A fake jira system which allows to work with sub-tasks.

Instance Method Summary collapse

Constructor Details

#initialize(issues) ⇒ Fake

Returns a new instance of Fake.



33
34
35
# File 'lib/lazylead/system/fake.rb', line 33

def initialize(issues = [])
  @issues = issues
end

Instance Method Details

#find(id) ⇒ Object



349
350
351
# File 'lib/lazylead/system/jira.rb', line 349

def find(id)
  @issues.detect { |i| i.id.eql? id }
end

#issuesObject



37
38
39
# File 'lib/lazylead/system/fake.rb', line 37

def issues(*)
  @issues
end

#raw {|OpenStruct.new(Issue: self)| ... } ⇒ Object

Execute request to the ticketing system using raw client.

Yields:

  • (OpenStruct.new(Issue: self))


344
345
346
347
# File 'lib/lazylead/system/jira.rb', line 344

def raw
  raise "ll-008: No block given to method" unless block_given?
  yield(OpenStruct.new(Issue: self))
end