Class: TrelloCli::Formatters::Base
- Inherits:
-
Object
- Object
- TrelloCli::Formatters::Base
show all
- Defined in:
- lib/trello_cli/formatters/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
6
7
8
|
# File 'lib/trello_cli/formatters/base.rb', line 6
def initialize(data)
@data = data
end
|
Instance Method Details
#output(format) ⇒ Object
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/trello_cli/formatters/base.rb', line 10
def output(format)
case format
when "json"
self.to_json
when "tsv"
self.to_tsv
else
self.to_legacy
end
end
|
#to_json ⇒ Object
21
22
23
|
# File 'lib/trello_cli/formatters/base.rb', line 21
def to_json
data.to_json
end
|