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



384
385
386
# File 'lib/lazylead/system/jira.rb', line 384

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))


379
380
381
382
# File 'lib/lazylead/system/jira.rb', line 379

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