Class: GithubMembers::Options
- Inherits:
-
Object
- Object
- GithubMembers::Options
- Defined in:
- lib/github_members/options.rb
Defined Under Namespace
Classes: ParseError
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#github_org ⇒ Object
Returns the value of attribute github_org.
-
#github_token ⇒ Object
Returns the value of attribute github_token.
-
#help ⇒ Object
Returns the value of attribute help.
-
#help_shown ⇒ Object
Returns the value of attribute help_shown.
-
#markdown_file ⇒ Object
Returns the value of attribute markdown_file.
-
#version ⇒ Object
Returns the value of attribute version.
-
#yaml_file ⇒ Object
Returns the value of attribute yaml_file.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(argv) ⇒ Options
Returns a new instance of Options.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/github_members/options.rb', line 16 def initialize(argv) self.github_token = ENV["GITHUB_TOKEN"].to_s args = parser.parse!(argv) self.help = parser.help + help_examples(parser.program_name) self.github_org = args.first self.markdown_file = Pathname(markdown_file || Defaults::MARKDOWN_FILE) self.yaml_file = Pathname(yaml_file || Defaults::YAML_FILE) rescue OptionParser::ParseError => e raise ParseError, e. end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
11 12 13 |
# File 'lib/github_members/options.rb', line 11 def fields @fields end |
#github_org ⇒ Object
Returns the value of attribute github_org.
7 8 9 |
# File 'lib/github_members/options.rb', line 7 def github_org @github_org end |
#github_token ⇒ Object
Returns the value of attribute github_token.
8 9 10 |
# File 'lib/github_members/options.rb', line 8 def github_token @github_token end |
#help ⇒ Object
Returns the value of attribute help.
12 13 14 |
# File 'lib/github_members/options.rb', line 12 def help @help end |
#help_shown ⇒ Object
Returns the value of attribute help_shown.
13 14 15 |
# File 'lib/github_members/options.rb', line 13 def help_shown @help_shown end |
#markdown_file ⇒ Object
Returns the value of attribute markdown_file.
9 10 11 |
# File 'lib/github_members/options.rb', line 9 def markdown_file @markdown_file end |
#version ⇒ Object
Returns the value of attribute version.
14 15 16 |
# File 'lib/github_members/options.rb', line 14 def version @version end |
#yaml_file ⇒ Object
Returns the value of attribute yaml_file.
10 11 12 |
# File 'lib/github_members/options.rb', line 10 def yaml_file @yaml_file end |