Class: MstdnAnalyzer::Analyzer
- Inherits:
-
Object
- Object
- MstdnAnalyzer::Analyzer
- Defined in:
- lib/mstdn_analyzer/analyzer.rb
Constant Summary collapse
- COLORS =
{ black: "\e[30m", red: "\e[31m", green: "\e[32m", yellow: "\e[33m", blue: "\e[34m", mugenta: "\e[35m", cyan: "\e[36m", white: "\e[37m", reset: "\e[m"}
- BACKGROUND_COLORS =
{ black: "\e[40m", red: "\e[41m", green: "\e[42m", yellow: "\e[43m", blue: "\e[44m", mugenta: "\e[45m", cyan: "\e[46m", white: "\e[47m", reset: "\e[m"}
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#cleint ⇒ Object
Returns the value of attribute cleint.
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#statuses ⇒ Object
Returns the value of attribute statuses.
Instance Method Summary collapse
-
#initialize(instance, username, **options) ⇒ Analyzer
constructor
A new instance of Analyzer.
- #result ⇒ Object
Constructor Details
#initialize(instance, username, **options) ⇒ Analyzer
Returns a new instance of Analyzer.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mstdn_analyzer/analyzer.rb', line 14 def initialize(instance, username, **) # オプションの解析 limit = [:limit] || 5000 is_inore_reblog = [:ignore_reblog] @instance = get_correct_instance(instance) @client = MstdnIvory::Client.new(@instance) @account = get_id_from_username(username) @statuses = get_statuses(limit, is_inore_reblog) end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
9 10 11 |
# File 'lib/mstdn_analyzer/analyzer.rb', line 9 def account @account end |
#cleint ⇒ Object
Returns the value of attribute cleint.
9 10 11 |
# File 'lib/mstdn_analyzer/analyzer.rb', line 9 def cleint @cleint end |
#instance ⇒ Object
Returns the value of attribute instance.
9 10 11 |
# File 'lib/mstdn_analyzer/analyzer.rb', line 9 def instance @instance end |
#statuses ⇒ Object
Returns the value of attribute statuses.
9 10 11 |
# File 'lib/mstdn_analyzer/analyzer.rb', line 9 def statuses @statuses end |
Instance Method Details
#result ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mstdn_analyzer/analyzer.rb', line 25 def result puts "Daily activity distribution(per hour)" puts_line display_activity_per_hour puts_line puts puts "Weekley activity distribution(per day)" puts_line display_activity_per_day puts_line end |