Class: ZMediumFetcher::Progress

Inherits:
Object
  • Object
show all
Defined in:
lib/ZMediumFetcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#currentPostIndexObject

Returns the value of attribute currentPostIndex.



35
36
37
# File 'lib/ZMediumFetcher.rb', line 35

def currentPostIndex
  @currentPostIndex
end

#currentPostParagraphIndexObject

Returns the value of attribute currentPostParagraphIndex.



35
36
37
# File 'lib/ZMediumFetcher.rb', line 35

def currentPostParagraphIndex
  @currentPostParagraphIndex
end

#messageObject

Returns the value of attribute message.



35
36
37
# File 'lib/ZMediumFetcher.rb', line 35

def message
  @message
end

#postPathObject

Returns the value of attribute postPath.



35
36
37
# File 'lib/ZMediumFetcher.rb', line 35

def postPath
  @postPath
end

#totalPostParagraphsLengthObject

Returns the value of attribute totalPostParagraphsLength.



35
36
37
# File 'lib/ZMediumFetcher.rb', line 35

def totalPostParagraphsLength
  @totalPostParagraphsLength
end

#totalPostsLengthObject

Returns the value of attribute totalPostsLength.



35
36
37
# File 'lib/ZMediumFetcher.rb', line 35

def totalPostsLength
  @totalPostsLength
end

#usernameObject

Returns the value of attribute username.



35
36
37
# File 'lib/ZMediumFetcher.rb', line 35

def username
  @username
end

Instance Method Details

#printLogObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/ZMediumFetcher.rb', line 37

def printLog()
    info = ""
    if !username.nil?
        if !currentPostIndex.nil? && !totalPostsLength.nil?
            info += "[#{username}(#{currentPostIndex}/#{totalPostsLength})]"
        else
            info += "[#{username}]"
        end
    end

    if !postPath.nil?
        if info != ""
            info += "-"
        end
        if !currentPostParagraphIndex.nil? && !totalPostParagraphsLength.nil?
            info += "[#{postPath[0..10]}...(#{currentPostParagraphIndex}/#{totalPostParagraphsLength})]"
        else
            info += "[#{postPath[0..10]}...]"
        end
    end

    if !message.nil?
        if info != ""
            info += "-"
        end
        info += message
    end

    if info != "" 
        puts info
    end
end