Class: HornOfPlenty::Adapters::Github::Parsers::Board
- Inherits:
-
Object
- Object
- HornOfPlenty::Adapters::Github::Parsers::Board
- Includes:
- Parsers::Hash
- Defined in:
- lib/horn_of_plenty/adapters/github/parsers/board.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #author_id ⇒ Object
- #created_at ⇒ Object
- #description ⇒ Object
- #id ⇒ Object
-
#initialize(raw:) ⇒ Board
constructor
A new instance of Board.
- #title ⇒ Object
- #updated_at ⇒ Object
Constructor Details
#initialize(raw:) ⇒ Board
15 16 17 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.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/board.rb', line 13 def raw @raw end |
Class Method Details
.to_model(raw_item) ⇒ Object
43 44 45 46 47 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.rb', line 43 def self.to_model(raw_item) return NullObjects::Board.instance unless raw_item Models::Board.from_parser(parser: new(raw: raw_item)) end |
Instance Method Details
#author_id ⇒ Object
23 24 25 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.rb', line 23 def ||= parse_text(raw, 'creator/:/login') end |
#created_at ⇒ Object
35 36 37 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.rb', line 35 def created_at @created_at ||= parse_time(raw, 'created_at') end |
#description ⇒ Object
31 32 33 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.rb', line 31 def description @description ||= parse_text(raw, 'body') end |
#id ⇒ Object
19 20 21 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.rb', line 19 def id @id ||= parse_text(raw, 'number') end |
#title ⇒ Object
27 28 29 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.rb', line 27 def title @title ||= parse_text(raw, 'name') end |
#updated_at ⇒ Object
39 40 41 |
# File 'lib/horn_of_plenty/adapters/github/parsers/board.rb', line 39 def updated_at @updated_at ||= parse_time(raw, 'updated_at') end |