class HornOfPlenty::Adapters::Github::Parsers::Lane

Attributes

raw[RW]

Public Class Methods

new(raw:) click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/lane.rb, line 15
def initialize(raw:)
  self.raw = raw
end
to_model(raw_item) click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/lane.rb, line 41
def self.to_model(raw_item)
  return NullObjects::Lane.instance unless raw_item

  Models::Lane.from_parser(parser: new(raw: raw_item))
end

Public Instance Methods

board_id() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/lane.rb, line 23
def board_id
  @board_id                              ||= parse_text(raw, 'project_url') do |url|
    url.match(%r{\A.*/(\d+)\z})[1]
  end
end
created_at() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/lane.rb, line 33
def created_at
  @created_at                            ||= parse_time(raw, 'created_at')
end
id() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/lane.rb, line 19
def id
  @id                                    ||= parse_text(raw, 'id')
end
title() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/lane.rb, line 29
def title
  @title                                 ||= parse_text(raw, 'name')
end
updated_at() click to toggle source
# File lib/horn_of_plenty/adapters/github/parsers/lane.rb, line 37
def updated_at
  @updated_at                            ||= parse_time(raw, 'updated_at')
end