Class: HornOfPlenty::Adapters::Github::Parsers::Lane
- Inherits:
-
Object
- Object
- HornOfPlenty::Adapters::Github::Parsers::Lane
- Includes:
- Parsers::Hash
- Defined in:
- lib/horn_of_plenty/adapters/github/parsers/lane.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #board_id ⇒ Object
- #created_at ⇒ Object
- #id ⇒ Object
-
#initialize(raw:) ⇒ Lane
constructor
A new instance of Lane.
- #title ⇒ Object
- #updated_at ⇒ Object
Constructor Details
#initialize(raw:) ⇒ Lane
Returns a new instance of Lane.
15 16 17 |
# File 'lib/horn_of_plenty/adapters/github/parsers/lane.rb', line 15 def initialize(raw:) self.raw = raw end |
Instance Attribute Details
#raw ⇒ Object
Returns the value of attribute raw.
13 14 15 |
# File 'lib/horn_of_plenty/adapters/github/parsers/lane.rb', line 13 def raw @raw end |
Class Method Details
.to_model(raw_item) ⇒ Object
41 42 43 44 45 |
# 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 |
Instance Method Details
#board_id ⇒ Object
23 24 25 26 27 |
# 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 ⇒ Object
33 34 35 |
# File 'lib/horn_of_plenty/adapters/github/parsers/lane.rb', line 33 def created_at @created_at ||= parse_time(raw, 'created_at') end |
#id ⇒ Object
19 20 21 |
# File 'lib/horn_of_plenty/adapters/github/parsers/lane.rb', line 19 def id @id ||= parse_text(raw, 'id') end |
#title ⇒ Object
29 30 31 |
# File 'lib/horn_of_plenty/adapters/github/parsers/lane.rb', line 29 def title @title ||= parse_text(raw, 'name') end |
#updated_at ⇒ Object
37 38 39 |
# File 'lib/horn_of_plenty/adapters/github/parsers/lane.rb', line 37 def updated_at @updated_at ||= parse_time(raw, 'updated_at') end |