Class: Checklister::Github::ProjectDecorator
- Inherits:
-
Object
- Object
- Checklister::Github::ProjectDecorator
- Defined in:
- lib/checklister/github/project.rb
Instance Method Summary collapse
- #description ⇒ Object
- #id ⇒ Object
-
#initialize(object) ⇒ ProjectDecorator
constructor
A new instance of ProjectDecorator.
- #name ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(object) ⇒ ProjectDecorator
Returns a new instance of ProjectDecorator.
4 5 6 7 8 |
# File 'lib/checklister/github/project.rb', line 4 def initialize(object) @object = Checklister::Sanitizer.symbolize JSON.parse(object) rescue TypeError @object = Checklister::Sanitizer.symbolize object end |
Instance Method Details
#description ⇒ Object
18 19 20 |
# File 'lib/checklister/github/project.rb', line 18 def description @object[:description] end |
#id ⇒ Object
10 11 12 |
# File 'lib/checklister/github/project.rb', line 10 def id @object[:id] end |
#name ⇒ Object
14 15 16 |
# File 'lib/checklister/github/project.rb', line 14 def name @object[:full_name] end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/checklister/github/project.rb', line 22 def to_hash { id: id, name: name, description: description } end |