Class: GAShikomi::Command
- Inherits:
-
Thor
- Object
- Thor
- GAShikomi::Command
- Defined in:
- lib/ga_shikomi/command.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #accounts ⇒ Object
- #dimensions ⇒ Object
- #filters ⇒ Object
- #ga ⇒ Object
- #goals ⇒ Object
-
#initialize(*args) ⇒ Command
constructor
A new instance of Command.
- #metrics ⇒ Object
- #profiles ⇒ Object
- #properties ⇒ Object
- #property ⇒ Object
- #segments ⇒ Object
Constructor Details
#initialize(*args) ⇒ Command
Returns a new instance of Command.
11 12 13 14 15 16 17 18 19 |
# File 'lib/ga_shikomi/command.rb', line 11 def initialize(*args) super if args.last[:current_command].name != 'help' store = (!.nil? && ['credential-store']) || File.join(Dir.pwd, '.ga-cli-credential') @api = Api.new(store) @config = Config.new(['config_file']).config if ['config_file'] end end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
20 21 22 |
# File 'lib/ga_shikomi/command.rb', line 20 def api @api end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
20 21 22 |
# File 'lib/ga_shikomi/command.rb', line 20 def config @config end |
Instance Method Details
#accounts ⇒ Object
32 33 34 |
# File 'lib/ga_shikomi/command.rb', line 32 def accounts Renderer.new(Subcommand::Accounts.new(api).list, ).render_accounts end |
#dimensions ⇒ Object
78 79 80 |
# File 'lib/ga_shikomi/command.rb', line 78 def dimensions Renderer.new(Subcommand::Metadata.new(api, ).dimensions, ). end |
#filters ⇒ Object
58 59 60 |
# File 'lib/ga_shikomi/command.rb', line 58 def filters Renderer.new(Subcommand::Filters.new(api, ).list, ).render_filters end |
#ga ⇒ Object
27 28 29 |
# File 'lib/ga_shikomi/command.rb', line 27 def ga Renderer.new(Subcommand::Ga.new(api, ).get(config), ).render_ga end |
#goals ⇒ Object
66 67 68 |
# File 'lib/ga_shikomi/command.rb', line 66 def goals Renderer.new(Subcommand::Goals.new(api, ).list, ).render_goals end |
#metrics ⇒ Object
72 73 74 |
# File 'lib/ga_shikomi/command.rb', line 72 def metrics Renderer.new(Subcommand::Metadata.new(api, ).metrics, ). end |
#profiles ⇒ Object
52 53 54 |
# File 'lib/ga_shikomi/command.rb', line 52 def profiles Renderer.new(Subcommand::Profiles.new(api, ).list, ).render_profiles end |
#properties ⇒ Object
38 39 40 |
# File 'lib/ga_shikomi/command.rb', line 38 def properties Renderer.new(Subcommand::Webproperties.new(api, ).list, ).render_properties end |
#property ⇒ Object
45 46 47 |
# File 'lib/ga_shikomi/command.rb', line 45 def property Renderer.new(Subcommand::Webproperties.new(api, ).get, ).render_properties end |
#segments ⇒ Object
83 84 85 |
# File 'lib/ga_shikomi/command.rb', line 83 def segments Renderer.new(Subcommand::Segments.new(api).list, ).render_segments end |